free code :- User define Amt of Discount in Sale Entry

Discussion in 'Free Source Codes' started by psjain_jal, Apr 27, 2013.

    
  1. psjain_jal

    psjain_jal Member


    Code:
    Change the Title to "Amt of Dis" as it appears in the Invoice                                   
    [#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: "Amt of Dis"                                   
    ;;Change the title to "Amt of Dis" 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: "Amt of Dis"                                   
    ;;Change the Title to "Discount Amt" as it appears in the Multiple Price list report                                   
    [#Field: MPSDiscountTitle]                                   
        Set as: "Discount Amt"                                   
    ;;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"                                   
    ;;Update the format attribute for Discount field as it appears in Batch sub-form                                   
    [#Field: VCHBATCH Discount]                                   
        Delete: Format                                   
        Add: Format: "Nopercent,NoZero"                                   
    ;;Required if there are no batch Allocations                                   
    [#Field: VCH Value]                                   
        Resetval: if (@@NoBaseUnits OR $$IsEmpty:BilledQty) then $$Value else (($Rate * $BilledQty) - $Discount)                                   
    
     


  2. Aniket

    Aniket New Member


    very good tdl. But problem when discount to be given on %. Can it be made like when we want % we can take % and when we want Rs. we can take that?
     




  3. nirexshan

    nirexshan New Member


    thank u sir
     



  4. Dear Sir,
    Thanks for the code. When we print the invoice, in printing it is still showing % in stead of Rs. also the formula of discount is incorrect which i have changed.

    Thanks
     


  5. Praveen Davis

    Praveen Davis Member


    Hi Kuber Mohindru,

    Can you please post the corrected code?

    Thanks in advance.
     



  6. Hello Praveen,

    Even I am waiting for the correct code to remove % sign on printing invoice with Rs.
     


  7. Praveen Davis

    Praveen Davis Member


    Hi Kuber Mohindru,
    Can you please let me know why the error "error in tdl 'part:EXPSMP Terms' Insufficient height to allocate!" appears when I try to take invoice print with the following settings:
    print mode: dot matrix mode or draft mode. Everything is OK in Neat mode!

    I can take other report prints using print mode: dot matrix mode or draft mode!
    (see the screenshot)
    [​IMG]
    https://www.dropbox.com/s/mhigv4fba7egdih/error.PNG
     


  8. sanskruti

    sanskruti Member


    HELLO PRAVEEN I M VIJAY KUMAR FROM BAGALKOT KARANATAKA FROM SANSKRUTI COMPUTERS IF YOU WANT TO
    REMOVE % SING IN INVOICE PRINT PUT THE CODE

    [#Field: EXPINV Discount]
    Delete: Format
    Add: Format: "Nopercent,NoZero"
     


  9. sanskruti

    sanskruti Member


    [#Field: EXPINV Discount]
    Delete: Format
    Add: Format: "Nopercent,NoZero"
     


  10. Raju Das

    Raju Das Member


    Hey Guys here is right code....


    [#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))
     
    sonam chetri likes this.


  11. R. VIJAY

    R. VIJAY Member


    can you update above code for purchase, sales, debit note and credit note direct enter amount not in percent in upload screen shots
     

    Attached Files:



  12. Raju Das

    Raju Das Member



    Bro here is it....

    [#Field: EI AccRate]
    Skip on : Yes
     


  13. R. VIJAY

    R. VIJAY Member


    working sir but i want i want rate field in screen shot
     

    Attached Files:



  14. R. VIJAY

    R. VIJAY Member


    working sir but i want i want rate field in screen shot
     


  15. R. VIJAY

    R. VIJAY Member


    working sir but i want i want rate field in screen shot
     

    Attached Files:



  16. Ras Raj

    Ras Raj Member


    Thanks for Good Code....

    but Discount in Amount not printed in POS invoice.

    in POS invoice discount calculated as Percentage.

    Please Help
     


  17. Ras Raj

    Ras Raj Member


    Dear Expert

    Discount in Amount not printed in POS invoice properly. In POS invoice discount calculated as Percentage.

    and how can i get Total of Discount in POS


    Thanks in Advance
     


  18. Ras Raj

    Ras Raj Member



  19. Ras Raj

    Ras Raj Member


    Dear Experts.... Please help
     


  20. kamal

    kamal Member


    Dear experts,
    Thanks in Advance
    how to delete Discount Line in POS Invoice and add before amount colomn.
     

    Attached Files:

    Ras Raj likes this.


  21. harishkhl43

    harishkhl43 New Member


    Discount amount is not showing in stock query. if it reflects there than it is complete
     


  22. laxminath singh

    laxminath singh New Member


    Sir i want double discount in percentage qty rate dis dis1 total
     


  23. priyaEaswar

    priyaEaswar Member


    Hii Guys, here is right Code (using for purchase voucher ). this also same for sales voucher.

    [#Line: EI ColumnOne]
    Add: Option: Disc EI ColumnOne: @@IsSales
    Add: Option: Disc EI ColumnOne: @@IsPurchase

    [!Line: Disc EI ColumnOne]
    Local: Field: VCH DiscTitle: Set as: "Disc Amt"
    Local: Field: Default : Style : Normal Bold

    [#Line: VCHBATCH ColumnOne]
    Add: Option: Disc EI ColumnName: @@IsSales
    Add: Option: Disc EI ColumnName: @@IsPurchase

    [!Line: Disc EI ColumnName]
    Local: Field: VCH DiscTitle: Info: "Disc Amt"


    [#Field: MPSDiscountTitle]
    Set as: "Discount Amt"



    [System: Formula]
    CalcedAmt: ($Rate * $BilledQty) - $BatchDiscount
    NrmlAmount: ($BilledQty * $Rate) - $BatchDiscount

    [# Field: EXPINV DiscTitle]

    Info : $$LocaleString:"Disc."
    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: VCH Discount]
    Delete: Format
    Add: Format: "Nopercent,NoZero"


    [#Field: VCHBATCH Discount]
    Delete: Format
    Add: Format: "Nopercent,NoZero"

    [#Field: VCH Value]
    Resetval: if (@@NoBaseUnits OR $$IsEmpty:BilledQty) then $$Value else (($Rate * $BilledQty) - $Discount)

    [#Field: EXPINV Discount]

    Use : Number Field
    Align : Right
    Style : Small
    Set as : $Discount
    Width : 5
    Border : Thin Left
    Format : "NoZero,NoPercentage"
    Invisible : If (@@IsJobOrderOut OR @@IsJobOrderIn OR (@@IsSales And (@@AcctsInvoice OR @@AcctsInvoiceMfgr))) Then Yes Else (NOT @@WithDiscount OR (NOT @@InvWithRate AND NOT @@InvWithAmt))
     
    sonam chetri likes this.


  24. V Shankar

    V Shankar New Member


    Hi, Can we enter the Dis Amount in Forex if so pls advice


     


Share This Page