Discount amt col. in voucher after Discount % col.

Discussion in 'Tally Developer' started by sattam, Feb 28, 2024.

    
  1. sattam

    sattam Active Member


    Dear Experts,
    Below Discount amt col. code is working fine but a minor problem which I failed to solve.
    The problem is in alter mode at Item allocation screen if we alter quantity or discount percent or rate and after accept the screen the cursor is automatically going to Date field instead of discount amount field
    Hope experts will solve this
    Thanks in advance.

    Code:
    [#Line : EI ColumnOne]
       
        Add:Option:EIColumnOnewithDiscAmt:Yes
       
    [#Line : EI ColumnTwo]
       
        Add:Option:EIColumnTwowithDiscAmt:Yes
       
    [#Line : EI InvInfo]
       
        Add:Option:EIInvInfowithDiscAmt:Yes
       
    [#Line : CI InvInfo]
       
        Add:Option:EIInvInfowithDiscAmt:Yes
    
    [!Line: EIColumnOnewithDiscAmt]
       
                Add : Right Fields : After : VCH DiscTitle:VCHDiscTitAmt
               
    [!Line: EIColumnTwowithDiscAmt]
       
                Add : Right Fields : After : VCH DiscTitle:VCHDiscTitAmt
                Local   : Field : VCH DiscTitAmt    : Info     : ""
               
    [!Line: EIInvInfowithDiscAmt]
       
                Add : Right Fields : After : VCH Discount:VCHDiscAmt
               
    [#Form: Export Invoice]
    
        Add:Option:EIInvInfowithDiscAmt:Yes
    
    [!Form: EIInvInfowithDiscAmt]
    
        Local           : Line          : VCH NarrPrompt    : Add   : Right Fields  : Before:EI ValueTotal:EIDiscAmtTotal
       
    [Field:VCHDiscTitAmt]
               
        Width       : @@VCHAmountWidth
        Setas       : $$LocaleString:"Disc Amt"
        Style       : Small Bold
        Align       : Right
        Skip        : Yes
        Fixed       : Yes
       
    [Field: VCHDiscAmt]
    
        Use         : Amount Forex Field
        Width       : @@VCHAmountWidth
        ResetVal    : If (@@NoBaseUnits OR $$IsEmpty:$BilledQty) then $$Value else(($Rate * $BilledQty *$Discount) / 100)
        Storage     : SatVCHDiscAmt
        Set always  : Yes
        Inactive    : $$IsSysName:#VchStockItem
        Set By Condition    : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): @ResetVal;$$Value
        Set By Condition    : Yes                    : @ResetVal
        On  : Accept        : Yes : Field Accept
       
    [Field: EIDiscAmtTotal]
    
        Use         : Amount Field
        Type        : Amount    : Forced
        Color        : Maroon
        Background    : Yellow
        Border : Totals
        Set as : $$CollNumTotal:InventoryEntries:$SatVCHDiscAmt
        Skip : Yes
        Set always : Yes
        Invisible:$$IsEmpty:($$CollNumTotal:InventoryEntries:$SatVCHDiscAmt)
       
    [System:UDF]
    
        SatVCHDiscAmt:Amount:2224
     


  2. vishnu joshi

    vishnu joshi Member


    Try this Sir..

    Code:
     [#Line : EI ColumnOne]
      
        Add:Option:EIColumnOnewithDiscAmt:Yes
      
    [#Line : EI ColumnTwo]
      
        Add:Option:EIColumnTwowithDiscAmt:Yes
      
    [#Line : EI InvInfo]
      
        Add:Option:EIInvInfowithDiscAmt:Yes
      
    [#Line : CI InvInfo]
      
        Add:Option:EIInvInfowithDiscAmt:Yes
    
    [!Line: EIColumnOnewithDiscAmt]
      
                Add : Right Fields : After : VCH DiscTitle:VCHDiscTitAmt
              
    [!Line: EIColumnTwowithDiscAmt]
      
                Add : Right Fields : After : VCH DiscTitle:VCHDiscTitAmt
                Local   : Field : VCH DiscTitAmt    : Info     : ""
              
    [!Line: EIInvInfowithDiscAmt]
      
                Add : Right Fields : After : VCH Discount:VCHDiscAmt
              
    [#Form: Export Invoice]
    
        Add:Option:EIInvInfowithDiscAmt:Yes
    
    [!Form: EIInvInfowithDiscAmt]
    
        Local           : Line          : VCH NarrPrompt    : Add   : Right Fields  : Before:EI ValueTotal:EIDiscAmtTotal
      
    [Field:VCHDiscTitAmt]
              
        Width       : @@VCHAmountWidth
        Setas       : $$LocaleString:"Disc Amt"
        Style       : Small Bold
        Align       : Right
        Skip        : Yes
        Fixed       : Yes
      
    [Field: VCHDiscAmt]
    
        Use         : Amount Forex Field
        Width       : @@VCHAmountWidth
        ResetVal    : If (@@NoBaseUnits OR $$IsEmpty:$BilledQty) then $$Value else(($Rate * $BilledQty *$Discount) / 100)
        Storage     : SatVCHDiscAmt
        Set always  : Yes
        Inactive    : $$IsSysName:#VchStockItem
        Set By Condition    : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): @ResetVal;$$Value
        Set By Condition    : Yes                    : @ResetVal
        On  : Accept        : Yes : Field Accept
      
    [Field: EIDiscAmtTotal]
    
        Use         : Amount Field
        Type        : Amount    : Forced
        ;Color        : Maroon
        Background    : Yellow
        Border : Totals
        Set as : $$CollNumTotal:InventoryEntries:$SatVCHDiscAmt
        Skip : Yes
        Set always : Yes
        ;Invisible:$$IsEmpty:($$CollNumTotal:InventoryEntries:$SatVCHDiscAmt)
      
    [System:UDF]
    
        SatVCHDiscAmt:Amount:2224
     
    sattam likes this.


  3. sattam

    sattam Active Member


    Thanks Vishnu Ji its worked
    Can you please explain when you commented this line
    ;Invisible:$$IsEmpty:($$CollNumTotal:InventoryEntries:$SatVCHDiscAmt)
    it working whats the logic
     


  4. vishnu joshi

    vishnu joshi Member


    invisible inactive or option are depend on current from field value.
    then it curser start from Starting Field form.
     
    sattam likes this.


Share This Page