[Help] Problem in storing values at voucher entry.

Discussion in 'Tally Developer' started by Rupal Agarwal, Dec 28, 2022.

    
  1. Rupal Agarwal

    Rupal Agarwal Member


    Hello everyone,

    I am using additional fields at voucher entry regarding vat calculations, but I am having an issue that my values are not getting saved like if I change the percentage of vat at stock item it will also change the vat rate at pervious voucher entries.

    My code :

    Code:
    [#Part: STKI Basic Features]  
        Add:Part:After:STKI Units: STKI Vat
      
    [Part: STKI Vat]
        Line : VAT Title, HPVat, HP Cess, HPVATRate
        Space Top: 1
        Local:Field:DEFAULT:Indent:0.5
    
    [Line: Vat Title]
        Use:form subtitle
        Local:Field: Form SubTitle :Info: "VAT Details"
        Local:Field: Form SubTitle :Align: Left
        Local:Field: Form SubTitle :Width: 10
        Local:Field: Form SubTitle :Delete:Full Width
        Space Top: 1
    
    [Line: HP Vat]
        Field: short Prompt, HP Vat,
        Local:Field:Short Prompt : Info: "VAT %"
      
    [Field: HP Vat]
        Use: Number Field
        Storage: HpVat
        Align: Left
        Width: 10
        Format : "Percentage"
      
    ;;------------------------------------------------------
    
    [Line:HP CEss]
        Field:Medium Prompt, HP Cess
        Local:Field:Medium Prompt : Info: "Add. VAT %"
    
    [Field: Hp Cess]
        Use: Number Field
        Storage: HpCess
        Align: Left
        Width: 10
        Format : "Percentage"
      
    [System:UDF]
        hpvat:Number:101
        hpcess:Number:102
    
    ;;----------------------------------------------------------
    
    [Line : HPVATRate]
    Field : Medium Prompt, HPVATRate
    Local : Field : Medium Prompt : Info : $$LocaleString:"VAT Inclusive % "
    
    [Field: HPVATRate]
    Use: Number Field
    Set as: #HpVat + (#HpVat * (#HPcess /100))
    Set Always:Yes
    Storage: RateofVAT
    Align : Left
    Width : 6
    Format : "Percentage"
    
    ;;==================================================================================================
    
    [#Line : EI Column One]
    Add   : Right Field: At Beginning:  VatValT,AddVatT, VatIncluT
    Add   : Right Field: before:VCH Rate Title : Tax Inc Titile
    
    [Field: VatValT]
        Use:Name Field
        Set as: "VAT %"
        Width: 5
        Align: Center
        Set Always: Yes
        Skip: Yes
    
    [Field: AddVatT]
        Use:Name Field
        Set as: "Cess %"
        Width: 5
        Align: Center
        Set Always: Yes
        Skip: Yes
    [Field:VatIncluT]
        Use:Name Field
        Set as: "Inc. %"
        Width: 7
        Align: Center
        Set Always: Yes
        Skip: Yes
    
    [#Line : EI Inv Info]
        Add: Right Field:At Beginning: VatVal, AddVat, VatInclu
    [Field: VatVal]
        Use:Number Field
        Set as: $HpVat:Stockitem:#vchStockItem
        Width: 5
        Align: Center
        Style: Normal  
        Set Always: Yes
        Skip Forward: Yes
        Format: "Percentage"
        Storage: Vatper
    [Field: AddVat]
        Use:Number Field
        Set as: $HpCess:Stockitem:#vchStockItem
        Width: 5
        Align: Center
        Style: Normal  
        Set Always: Yes
        Skip Forward: Yes
        Format: "Percentage"
        Storage:CessPer
    [Field:Vat Inclu]
        Use:number Field
        Set as: #VatVal + (#VatVal * (#AddVat /100))
        Width: 7
        Align: Center
        Style: Normal  
        Set Always: Yes
        Skip Forward: Yes
        Format: "Percentage"
        Storage: IncPer
      
    [System:UDF]
        vatper : Number: 110
        cessper : Number: 111
        incper : Number: 112
     


Share This Page