How to set default discount % in sales

Discussion in 'Tally Developer' started by Properson2020, Feb 17, 2022.

  1. Properson2020

    Properson2020 New Member

    my default discount rate is not working
    but narration is working in sales bill

    [#Field : VCH Discount]
    Set As : 10
    Set Always : Yes

    [#Field: VCH Narration]
    Set Always: Yes
    Set As: 10

  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member

    Study the Field in Developer....... there are many "set by condition" in that Field.....

    So you above code will not work, as it is getting overridden by the various conditions.

    Understand and study the same and use it to set your default value.

  3. Properson2020

    Properson2020 New Member

    I read about "set by condition" and about field "VCH Discount" in tally developers

    My New Code
    [#Field : VCH Discount]
    Delete:Set By Condition
    Set As : 10
    Set Always : Yes
    [#Field: VCH Narration]
    Set Always: Yes
    Set As: 10
    but it effect other facility in discount

    VCH Discount Field
    [Field: VCH Discount]
        Use         : Number Field
        Width       : @@VCHDiscountWidth
        Align       : Right
        Style       : Normal Bold
        Storage     : Discount
        Set always  : Yes
        Format      : "NoZero,Percentage"   
        ;;Invisible in case of job work ou/in orders else based on withdiscount or acctinvoice conditions
        Invisible   : If (@@IsJobOrderOut OR @@IsJobOrderIn OR @@IsJobMaterialIssue OR @@IsJobMaterialReceive ) Then Yes Else NOT @@WithDiscount OR @@AcctsInvoice
    /*If Stock item name is not available  OR /   
    /*If Stock item  is not having any base units Or Voucher is not in invoice mode then return yes*/   
    /*If Discount option is not on or hasdiscount is false return Yes */
        Inactive    : $$IsEnd:$StockItemName OR @@NoBaseUnits OR NOT (@@IsInvoice OR @@RejInvoice) OR (NOT $$IsDiscountsOn AND NOT $HasDiscounts)
    /*If TrackingNo is available or BatchWise OR Company is activated for multigodown or Order Then keep value as it is*/
        Set By Condition    : @@IsPOSInvoice             : If $$IsValidPriceLevel:$PriceLevel then @@StdVchDiscount Else $$Value
        Set By Condition    : @@HasInvSubAlloc             : $$Value
    /* If Billed Quantity is not available then Set Value 0*/
        Set By Condition    : $BilledQty= 0          : 0       
        Set By Condition    : @IsBilledQtyEdited        : @@StdVchDiscount
    /*If Price level is Valied Then set std discount*/
        Set By Condition    : ($$IsValidPriceLevel:$PriceLevel)    and ($Rate = 0): (if NOT @@IsOutwardType then $Discount else +
        Set By Condition    : ($$IsValidPriceLevel:$PriceLevel) and ($$Isempty:$$value) and ($Rate != 0) : $$value
    /*In alter mode or if field is edited OR field is having some value then keep value as it is */
        Set By Condition    : ($$IsFieldEdited OR $$InAlterMode OR NOT $$IsEmpty:$$Value): $$Value
        Set By Condition    : Yes                    : @@StdVchDiscount
        Skip on                : $$GetIsVCHDiscountSkipOn:$BilledQty
        IsBilledQtyEdited : (@@InvoiceinCreate) and ($$IsFieldEdited:VchBilledQty or $$IsFieldEdited:EIPriceLevel OR $$IsFieldEdited:EIConsignee OR $$IsFieldEdited:VCHStockItem) and ( Not ##ICFGEditAll OR (@@IsPrevPLDiscount))
        Option              : VCH POSDiscount       : @@IsPOSInvoice

  4. Himanshu-2002

    Himanshu-2002 Active Member

    Do it like this
    [#Field : VCH Discount]

    [! Field:IsBlankDiscount]
    Delete:Set By Condition
    Delete:Set As
    Add:Set As:10

  5. gangstar

    gangstar Member

    Sir How to get same value in Field: Vchbatch discount?

Share This Page