Discount percentage into amount

Discussion in 'General Discussions' started by Naveen007, Jan 10, 2017.

    
  1. Naveen007

    Naveen007 New Member


    Hi! I have a code for changing discount percentage into amount. It changed successfully but the rate of item changes automatically. Here I attached the picture please help for not to change the rate automatically.


    [#Line: EI ColumnOne]
    Add: Option: Disc EI ColumnOne: @@IsSales
    ;;Optional definition for the line "Disc EI ColumnOne"
    [!Line: Disc EI ColumnOne]
    Local: Field: VCH DiscTitle: Set as: "Cash Discount"
    Local:Field:VCH DiscTitle:Width:8
    Local:Field:VCH DiscTitle:Align:Center
    Local:Field:VCH DiscTitle:Style:Normal Bold

    ;;Change the title to "Cash Discount" as it appears in the Batch subform
    [#Line: VCHBATCH ColumnOne]
    Add: Option: Disc EI ColumnName: @@IsSales
    ;;Optional definition
    [!Line: Disc EI ColumnName]
    Local: Field: VCH DiscTitle: Info: "Cash Discount"
    Local:Field:VCH DiscTitle:Width:7
    Local:Field:VCH DiscTitle:Align:Center
    ;;Change the Title to "Discount Amt" as it appears in the Multiple Price list report
    [#Field: MPSDiscountTitle]
    Set as: "Cash Discount"
    Width:7
    Align:Center
    ;;Reclaculate formula's
    [System: Formula]
    CalcedAmt: ($Rate * $BilledQty) - $BatchDiscount
    NrmlAmount: ($BilledQty * $Rate) - $BatchDiscount
    ;;Update the format attribute for Discount field as it appears in the Invoice
    [#Field: VCH Discount]
    Delete: Format
    Add: Format: "Nopercent,NoZero"
    Width:7
    Align:Center
    ;;Update the format attribute for Discount field as it appears in Batch sub-form
    [#Field: VCHBATCH Discount]
    Delete: Format
    Add: Format: "Nopercent,NoZero"
    Width:7
    Align:Center
    ;;Required if there are no batch Allocations
    [#Field: VCH Value]
    Resetval: if (@@NoBaseUnits OR $$IsEmpty:BilledQty) then $$Value else (($Rate * $BilledQty) - $Discount)

    [#Field: EXPINV DiscTitle]

    Use : NumberTitleField
    Info : $$LocaleString:"CD Amount"
    Border : Thin Left
    Align : Centre
    Width : 5
    Style : Small
    Invisible : If (@@IsJobOrderOut OR @@IsJobOrderIn OR (@@IsSales And (@@AcctsInvoice OR @@AcctsInvoiceMfgr))) Then Yes Else (NOT @@WithDiscount OR (NOT @@InvWithRate AND NOT @@InvWithAmt))


    [#Field: EXPINV Discount]

    Delete: Format
    Width : 5
    Border : Thin Left
    Format : "NoZero,Percentage"
    Invisible : If (@@IsJobOrderOut OR @@IsJobOrderIn OR (@@IsSales And (@@AcctsInvoice OR @@AcctsInvoiceMfgr))) Then Yes Else (NOT @@WithDiscount OR (NOT @@InvWithRate AND NOT @@InvWithAmt))


    1.JPG 2.JPG
     


  2. vinrid

    vinrid New Member


    How to Total discount for discount column
     


Share This Page