DUPLICATE PURCHASE BILLS BLOCKING

Discussion in 'Free Source Codes' started by FreeLance Tech, Mar 11, 2020.

    

  1. [#Field: EI Consignee]

    Add : Option : EIConsDupNumbBlock : Not $$InAlterMode And @@IsPurchase

    [!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

    [!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
     


  2. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Nice...

    Kindly put your code in Code window provided in Insert Button.. It looks better and Format is also maintained ... (And it is easy to Copy Paste ..:D:D)
     



  3. 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
     


  4. Sanjay preethi San

    Sanjay preethi San New Member


    Doesn't working Altermode
     


  5. Rajesh Karanth

    Rajesh Karanth New Member


    Modified code. Working fine
    Code:
    [#Field: EI Consignee]
    
        Control     : DuplicateNumberWAR : If (Not $$IsEmpty:#VCHRef) AND (Not $$InAlterMode) Then @IsSupplierNO Else No
        IsSupplierNO: ($$FilterValue:$SuppilerINVNumber:SupplierNumberColletion:1:IsSamePurchaseVCH) = #VCHRef
    
     
    [#Field    : VchParticulars]
     
        Control        : DuplicateNumberWAR : If (Not $$IsEmpty:#VCHRef) And ($$Line = 1) AND (Not $$InAlterMode) 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: Formula]
    
        IsSamePurchaseVCH     : $SuppilerINVNumber = #VCHRef
        DuplicateNumberWAR    : $$LocaleString:"Duplicated Purchase" + $$NewLine + "" + $$NewLine + "This Invoice is Already Entered...!" + +
                                $$NewLine + "Please Check Party Ledger...!"
    
    
    ;;;;;;End code;;;;;
     


Share This Page