i need help with the code to alter the sales price basing on a percentage entered on button click

Discussion in 'Requests' started by shaban kyasanku, Jul 8, 2023.

    
  1. shaban kyasanku

    shaban kyasanku New Member


    [#Module: AlterSalesPrice]
    Add: AddSalesPriceButton

    [#Form: AlterSalesPriceForm]
    Use: AddSalesPriceButton
    [Button: AddSalesPriceButton]
    Method: OnButtonClick
    [Field: PercentageField]
    Type: Number
    Label: Enter Percentage
    [Button: AddSalesPriceButton]
    Method: OnButtonClick
    [Field: PercentageField]
    Type: Number
    Label: Enter Percentage
    [Action: UpdateSalesPrice]
    Include: STDVouch
    Script:
    Procedure UpdateSalesPrice
    Variable: SalesPrice
    Variable: Percentage
    Variable: NewSalesPrice

    Percentage = $$PercentageField
    SalesPrice = $$VoucherAmount

    NewSalesPrice = SalesPrice + (SalesPrice * (Percentage / 100))

    $$VoucherAmount = NewSalesPrice

    SetFocus($$VoucherAmount)
    EndProcedure
     


Share This Page