Adding Fields in Payment voucher and calculated

Discussion in 'Free Source Codes' started by priyaEaswar, Mar 16, 2016.

    
  1. priyaEaswar

    priyaEaswar Member


    Dear Experts,

    How to I calculate the Dis(Amount) Calculate in payment voucher.

    [# Line: VCHBILL CTLineOne]

    Add: Right Field :after : VCHBILL DrCrTitleOne: Vch Discnt,Vch Disamt, Vch ValueT

    [# Line: VCHBILL CTLineTwo]

    Add: Right Field :after : VCHBILL DrCrTitleTwo: DisT,DisAnt,ValutT


    [# Line: VCHBILL MainLine]

    Add : Right Field : After : VCHBILLDrCr : VchDis, Vchamt ,Vch valueamt


    [Field: Vch Discnt]

    Width : @@VCHAmountWidth
    Setas : $$LocaleString:"Dis (%)"
    Style : Small Bold
    Align : Right
    Skip : Yes
    Fixed : Yes

    [Field: VchDis]

    Use : Number Field
    Width : @@VCHAmountWidth
    Storage : vchDis
    Set always : Yes
    Align : Right
    Format : "No Zero,Percent"

    [Field: Vch Disamt]

    Width : @@VCHAmountWidth
    Setas : $$LocaleString:"Dis(Amt)"
    Style : Small Bold
    Align : Right
    Skip : Yes
    Fixed : Yes

    [Field: Vchamt]

    Use : Amount Field
    Width : @@VCHAmountWidth
    Storage : vchDisAmt
    Set always : Yes
    Align : Right

    [Field : Vch ValueT]

    Width : @@VCHAmountWidth
    Setas : $$LocaleString:"Total Amount"
    Style : Small Bold
    Align : Right
    Skip : Yes
    Fixed : Yes

    [Field: Vch valueamt]

    Use : Amount Field
    Width : @@VCHAmountWidth
    Storage : Value
    ;Set By Condition: (($Amount*$vchDis)/$$Number:100);then $$Value else ($Amount-$vchDisAmt)
    Set as : ($Amount*$vchDis)/$$Number:100
    ;Set as : @MyFormula2
    Set always : Yes
    Align : Right


    [System : UDF]

    vchDis : Number : 15241
    vchDisAmt : Amount : 15245
    Value : Amount : 15250

    [# Line: VCHBILL Total]

    Add : Right Fields : After : VCHBILL DrCrTotal : Vch DiscntTotal, Vch DisamtTotal,Vch ValueTotalFld

    [Field: Vch DiscntTotal]

    Use : Amount Forex Field
    Width : @@VCHAmountWidth
    Border : Totals
    Skip : Yes
    ; Set as : $$AsPositive:$$Total:VCHBillAmt
    Set always : Yes

    [Field: Vch DisamtTotal]

    Use : Amount Forex Field
    Width : @@VCHAmountWidth
    Border : Totals
    Skip : Yes
    ; Set as : $$AsPositive:$$Total:VCHBillAmt
    Set always : Yes

    [Field: Vch ValueTotalFld]

    Use : Amount Field
    Width : @@VCHAmountWidth
    Border : Totals
    Skip : Yes
    Set as : $$AsPositive:$$Total:Vchvalueamt
    Set always : Yes

    [Field: DisT]

    Width : @@VCHAmountWidth
    Set as : ""
    Skip : Yes

    [Field: DisAnt]

    Width : @@VCHAmountWidth
    Set as : ""
    Skip : Yes

    [Field: ValutT]

    Width : @@VCHAmountWidth
    Set as : ""
    Skip : Yes
     


  2. priyaEaswar

    priyaEaswar Member


    Dis(%) Calculated correctly but Dis(Amt) how to calculate.
     


  3. Sanjeev S

    Sanjeev S Active Member


    Mam,

    Small mistake. Just change these two fields as

    [Field: Vchamt]

    Use : Amount Field
    Width : @@VCHAmountWidth
    Set as : ($Amount*$vchDis)/$$Number:100 ;changed
    Storage : vchDisAmt
    Set always : Yes
    Align : Right

    [Field: Vch valueamt]

    Use : Amount Field
    Width : @@VCHAmountWidth
    Storage : Value
    Set as : $Amount - #VchAmt ;changed
    Set always : Yes
    Align : Right

    Regards,
     


  4. priya

    priya Member


    Hi, it is working after Mr. sanjeev's suggestion. But the payment amount reduced in the 'select screen' is not effected in the payment screen. Should not the discount amount be properly reduced in the original amount and accordingly voucher payment altered. Correct me if I am wrong somewhere. Thanks for a good contribution. Happy HOLI to you.
     


  5. priyaEaswar

    priyaEaswar Member


    Dear Sir,

    I have to put some value in Dis(%)

    For Example:

    Dis(%) Calculated Correctly

    Amount = 2750
    Dis(%) = 5%
    Dis(Amt) = Empty
    Total Amount = 137.50

    Dis(Amt) Not calculated

    Amount = 2750
    Dis(%) = Empty
    Dis(Amt) = 750
    Total Amount = (Not calculated)

    please correct this.
     


  6. priyaEaswar

    priyaEaswar Member


    Dear Sir,

    I have to put some value in Dis(%)

    For Example:

    Dis(%) Calculated Correctly

    Amount = 2750
    Dis(%) = 5%
    Dis(Amt) = Empty
    Total Amount = 137.50

    I have to put some value in Dis(Amt)

    For Example:

    Dis(Amt) Not calculated

    Amount = 2750
    Dis(%) = Empty
    Dis(Amt) = 750
    Total Amount = (Not calculated)

    please correct this.
     



  7. Check this code,

    [#Part: VCHBILL Allocation]
    Total: Vch valueamt

    [Field: Vch valueamt]

    Use : Amount Field
    Width : @@VCHAmountWidth
    Set as : ($Amount - @DiscAmt)-$vchDisAmt
    DiscAmt: ($Amount*$vchDis)/$$Number:100
    Storage : Value
    Set always : Yes
    Align : Right
     


  8. priyaEaswar

    priyaEaswar Member


    Thank u Sir.
     


Share This Page