Free Code :Duplicate Purchase Stopper(By PartyName)

Discussion in 'Free Source Codes' started by Jay kumar tailor, Dec 15, 2019.

         
  1. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    Hi All...
    Jay Here..
    Just Modified An Code.

    Now It Works With Party Name

    (Only Control In Purchase Voucher)

    Hope You Will Like This...


    Code:
    [#Field: Vch Ref]
    On:Accept:Yes:Field Accept
        On:Accept:Yes:Call:Refreshtdls
    
    [Function:Refreshtdls]
    01 : Refresh TDL
    
    [#Field : EiConsignee]
    Control : IsTitle : IF $$IsPurchase:$VoucherTypeName And ($$InCreatemode OR $$InDuplicateMode) Then @@ChkVal Else ""
    Set Always :Yes
    [Collection : VchrefColl]
    
    Type : Voucher
    Fetch : VoucherNumber , Reference,Ledgername
    Filter : FltVal
    Filter : FltValJK
    
    [System : Formulas]
    
    IsTitle : "ERROR !!"+$$NewLine+$$NewLine+"Duplicate Reference No."+$$NewLine+$$NewLine+"Please Check Invoice No."+$$NewLine+$$NewLine+$$NewLine+"(Code By:-Jay Kumar Tailor,Sikar)"
    
    ChkVal : NOT $$ISEMPTY:$Reference And $PartyLedgerName =#EiConsignee AND $$NumItems:VchrefColl > 0
    
    FltVal : $Reference = #VchRef
    FltValJK:$LedgerName = #EiConsignee
      
     
    Last edited: Dec 19, 2019



  2. Very Nice sir, you are amazing
     


  3. Bipin Damania

    Bipin Damania Active Member


    Jayji

    Thanks for sharing...

    Please check, Working in Invoice Mode & Not in Journal Mode.
     


  4. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    Issue Has Been Resolved.

    Now It Works In Voucher Mode Also.

    Please Check...

    Code:
    [#Field: Vch Ref]
    On:Accept:Yes:Field Accept
        On:Accept:Yes:Call:Refreshtdls
    
    [Function:Refreshtdls]
    01 : Refresh TDL
    [#Field : Vch Particulars]
    Control : IsTitle : IF (($$IsPurchase:$VoucherTypeName) AND ($$Line = 1)) AND  ($$InCreatemode OR $$InDuplicateMode) Then @@ChkVal1 Else ""
    [#Field : EiConsignee]
    Control : IsTitle : IF $$IsPurchase:$VoucherTypeName And ($$InCreatemode OR $$InDuplicateMode) Then @@ChkVal Else ""
    Set Always :Yes
    
    [Collection : VchrefColl]
    Type : Voucher
    Fetch : VoucherNumber , Reference,Ledgername,PartyLedgerName
    Filter : FltVal
    Filter :FltValjk
    
    
    [Collection : VchrefColl1]
    Type : Voucher
    Fetch : VoucherNumber , Reference,Ledgername,PartyLedgerName
    Filter : FltVal
    Filter :FltValjkt
    Filter :vchjktype
    
    [System : Formulas]
    
    IsTitle : "ERROR !!"+$$NewLine+$$NewLine+"Duplicate Reference No."+$$NewLine+$$NewLine+"Please Check Invoice No."+$$NewLine+$$NewLine+$$NewLine+"(Code By:-Jay Kumar Tailor,Sikar)"
    
    ChkVal : NOT $$ISEMPTY:$Reference And $LedgerName =#EiConsignee AND $$NumItems:VchrefColl > 0
    
    ChkVal1 : NOT $$ISEMPTY:$Reference And $LedgerName =#VchParticulars AND $$NumItems:VchrefColl1 > 0
    
    FltVal : $Reference = #VchRef
    FltValjk :($LedgerName =#EiConsignee )
    FltValjkt :$LedgerName =#VchParticulars
    vchjktype:$$IsPurchase:$VoucherTypeName
    
     
    Last edited: Dec 28, 2019


  5. jgkumar1976

    jgkumar1976 Member


    Hi,

    I am trying to write the Code for contrl the Sales returns( Credit Note) which the party returned, not to enter in duplicate by unknowingly

    but i am not getting the results , please assist me where is that fault coding


    [#Field: GST TransInfo SuplierCNDNNo]

    On:Accept:Yes:Field Accept
    On:Accept:Yes:Call:cndnRefreshtdls

    [function : cndnRefreshtdls]
    01 : Refresh TDL

    [#Field : EiConsignee]
    Control : IsTitle : IF $$Iscreditnote:$VoucherTypeName And ($$InCreatemode OR $$InDuplicateMode) Then @@cndnChkVal Else ""
    Set Always :Yes

    [Collection : cndnVchrefColl]
    use : GST_eWayBillSrcFetchTemplate
    ;Type : Voucher
    ;type : GST_eWayBillSrcFetchTemplate
    Source Prefetch : VoucherNumber ,VATPartyTransReturnNumber,LedgerName,PartyLedgerName

    Filter : cndnFltVal
    Filter : Fltvalparty

    [System : Formulas]
    IsTitle : "ERROR !!"+$$NewLine+$$NewLine+"Duplicate Debit Note No."+$$NewLine+$$NewLine+"Please Check Debit Note No."

    cndnChkVal : NOT $$ISEMPTY:$VATPartyTransReturnNumber AND $$NumItems:cndnVchrefColl > 0

    cndnFltVal : $VATPartyTransReturnNumber = #GSTTransInfoSuplierCNDNNo

    Fltvalparty : $LedgerName = #EIconsignee


    [​IMG]
     


  6. jgkumar1976

    jgkumar1976 Member



  7. Rohit Khedar

    Rohit Khedar Member


    post sucess code plz
     


  8. Rohit8811

    Rohit8811 New Member


    This is super TDL sir,
    but slightly slow after select party name.









     



  9. Try This



    Code:
    [#Field: EI Consignee]
    
        Add : Option : EIConsDupNumbBlock : Not $$InAlterMode And @@IsPurchase And $CMPPurcDupBlock:Company:##SVCurrentCompany = Yes
    
    [!Field: EIConsDupNumbBlock]
    
        Control     : DuplicateNumberWAR : If (Not $$IsEmpty:#VCHRef) Then @IsSupplierNO Else No
        IsSupplierNO: ($$FilterValue:$SuppilerINVNumber:SupplierNumberColletion:1:IsSamePurchaseVCH) = #VCHRef
       
    [#Field    : VchParticulars]
       
        Add : Option : EIConsDupNumbBlockVCH : Not $$InAlterMode And @@IsPurchase And $CMPPurcDupBlock:Company:##SVCurrentCompany = Yes
       
    [!Field    : EIConsDupNumbBlockVCH]
           
        Control        : DuplicateNumberWAR : If (Not $$IsEmpty:#VCHRef) And ($$Line = 1) Then @IsSupplierNO Else No
        IsSupplierNO: ($$FilterValue:$SuppilerINVNumber:SupplierNumberColletionVCH:1:IsSamePurchaseVCH) = #VCHRef
    
    ;----------------------------------------------------------------------------------------------------------------------------------------;
    
    [Collection: SuppilerVCHCollletion]
    
        Type         : Vouchers     : Ledger
        Child Of     : #EIConsignee
        Fetch         : Reference, VoucherTypeName, *
        Filter         : IsPurchaseVoucherType
    
    [Collection: SupplierNumberColletion]
    
        Source Collection : SuppilerVCHCollletion
        By         : SuppilerINVNumber : $Reference
       
    [Collection: SuppilerVCHCollletionVCH]
    
        Type         : Vouchers     : Ledger
        Child Of     : #VchParticulars
        Fetch         : Reference, VoucherTypeName, *
        Filter         : IsPurchaseVoucherType
       
    [Collection: SupplierNumberColletionVCH]
    
        Source Collection : SuppilerVCHCollletionVCH
        By         : SuppilerINVNumber : $Reference
       
    [System: Formulae] 
    
        IsSamePurchaseVCH     : $SuppilerINVNumber = #VCHRef
        DuplicateNumberWAR    : $$LocaleString:"Duplicated Purchase" + $$NewLine + "" + $$NewLine + "Already Entered this Party Purchase...!" + + 
                                $$NewLine + "Please Check Purchase...!"
                               
        IsLedgerGRPBranch    : $$collectionField:$ParentHierarchy:(@@NosGrpVehicleBrn):ParentHierarchy = "Branch / Divisions"
        NosGrpVehicleBrn    : $$NumItems:ParentHierarchy
        IsControlCondCMP     : $IseCommOperator AND NOT $$IsEmpty:$$Value
     


Share This Page