Monday, October 2, 2017

Free TDL code for setting Discount or Scheme Amount during Sales Invoice

TDL code for setting Discount or Scheme Amount during Sales Invoice


As we all know Tally.ERP 9 does not have the feature to give discount or Scheme based on Amount and has feature of percentage only. This TDL code will allow you to set the discount  or Scheme based on Amount.

Note:- You might need to check the Tax calculation depending on how the transaction is This is code will just help you to set discount or scheme by amount.

To learn how to attached this code to Your Tally.ERP9 software please follow the instructions at
http://tallyexperttips.blogspot.in/2017/09/how-to-attach-any-tallyerp9.html


Code:----

[#Line : EI Column One]
Add : Right Field: After: VCH RateUnitsTitle: OTSCustomerSchemeAmountTitle

[Field:OTSCustomerSchemeAmountTitle]
Use: Name Field
Set as: "Scheme Amt"
Align: Centre
Skip: Yes
Border: Thick Left Right
Width:10
Invisible: If @@IsSales then No else Yes

[#Line : EI Inv Info] ;; Inventory Repeat Line - - With out Class
Add : Right Fields: After : VCH RateUnit: OTSCustomerSchemeAmount

 [#Line : CI Inv Info] ;; Inventory Repeat Line - - With Class

Add : Right Fields: After : VCH RateUnit: OTSCustomerSchemeAmount

[Field:OTSCustomerSchemeAmount]
Use: Amount Field
Width:10
Storage:OTSSchemeAmount
Invisible: If @@IsSales then No else Yes

[System:UDF]
OTSSchemeAmount:Amount:1234

[#Field: EI Value]   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Change the code as per your requirement in my code the ledger name should contain the word scheme to get the total
SetbyCondition :   $LedgerName Contains "Scheme" : $$AsAmount:$$CollAmtTotal:Inventoryentries:$OTSSchemeAmount
Set Always: Yes

After attaching the code you will find one new column Named sch
eme (in my case and as per above code but you can change the name of the column by editing the code).

Step 1 Select the Party ledger.

Step 2 Select the sales ledger (if use common ledger for account allocation is no ).

Step 3 Select the stock Item. Put the Qty, Rate and in then scheme column use the (-) minus sing and put the amount if you don't use the sing it will add it to the invoice amount.

Step 4 After selecting all the items and filling scheme amount were ever you need. Select the Scheme ledger in which you want to post this figure ( Note the Ledger name should contain the word "Scheme" ) in above code case. But it you want something different just edit the code.  It will take the total of scheme column and put the total with minus or the plus sing depending what is used.


3 comments:

  1. Sir, I want More than one Column for discount amount.
    i made more than one copies of this code/file and changed heading names and changed field name [Field:OTSCustomerSchemeAmountSYNG2Title] in all files
    But its not saved the value, after saving the voucher.
    please help me.

    ReplyDelete
    Replies
    1. Just copying code and changing field name will not work you will have to create udf to for those fields then only it will work

      Delete
  2. Print mei show nhi kar rha hain column.

    ReplyDelete