auto payment function not working

Discussion in 'Free Source Codes' started by ankur daga, May 16, 2021.

    
  1. ankur daga

    ankur daga Member


    Dear admin,
    With the help of codes available on this forum, i have made the following auto payment function, but the code in the bank allocation section is not working and the corresponding values are not getting stored in the bank allocation of that particular payment entry.


    Code:
    [Function: PaymentVchCreatebank]
        Variable    : BankLedger    : String
        Variable    : AnkChequeAmount    : Amount
        Variable    : AnkChequeBank    : String
        Variable    : AnkChequeNo        : String
        Variable    : AnkChequeDate    : Date
        Variable    :AnkPayFavouring:String
        Variable    : VchType        : String
        Variable    : VchCostCentre    : String
        Variable    : VchDate        : Date   
        Variable    : VchNarration    : String
        Variable    : VCHAmount        : Amount
        Variable    : VCHNumber        : String
    
        040    : Set    : BankLedger    : $POSChequeLedger
        050    : Set    : AnkChequeAmount    : $PayPOSBankAmount
        060    : Set    : AnkChequeBank    : $POSChequeBankName
        070    : Set    : AnkChequeNo        : $POSChequeNumber
        080    : Set    : AnkChequeDate    : $POSChequeDate
        090 : Set    : AnkPayFavouring:$PartyLedgerName1
        110    : Set    : VchType        : $$VchTypePayment
        115    : Set    : VchCostCentre    : $AutoCostLevel
               
        120    : SET    : VchDate        : $DATE
        130 : SET     : VCHAmount        :  ##AnkChequeAmount
        140 : SET    : VchNarration    : "Bill No.: " + $$String:$VoucherNumber
        141    : Set    : VCHNumber        : $VoucherNumber
    
        150 : QUERYBOX : "Create CHEQUE Payment Voucher ?":Yes:No
    
        160    : IF : $$LastResult
        170    : NEW OBJECT : VOUCHER
        180    :   SET VALUE    : Date                        : ##VchDate
        185    :   Set Value    : AUTOCOSTLEVEL                : ##VchCostCentre
        190    :   SET VALUE    : VoucherTypeName            : ##VchType
        200 :   SET         : SVViewName                : $$SysName:AcctgVchView
    
        210    :         INSERT COLLECTION OBJECT                : AllLedgerEntries
        220    :        SET VALUE        : LedgerName            : $PartyLedgerName
        230    :         SET VALUE        : Amount                : -1 * ##VCHAmount
        240    :         SET VALUE        : Is Deemed Positive    : "Yes"
    
        250    :             INSERT COLLECTION OBJECT                : BillAllocations
        260    :                SET VALUE        : Name                    : ##VCHNumber
        270    :               SET VALUE         : BillType                : "AgstRef"
        280    :                 SET VALUE        : Amount                : -1 * ##VCHAmount
        290    :                 SET TARGET        : ...
    
        370    : If    : NOT $$IsSysName:##BankLedger
        380    :       INSERT COLLECTION OBJECT                : LedgerEntries
        390    :        SET VALUE        : LedgerName            : ##BankLedger
        400    :         SET VALUE        : Amount                : -1 * ##AnkChequeAmount
        410    :         SET VALUE        : Is Deemed Positive    : "No"
       
        420    :             INSERT COLLECTION OBJECT                : BankAllocations ;; This section values are not getting reflected in the payment bank
        422 :                 SET VALUE         : TransactionType         : $$Sysname:ChequeDD
        423    :                SET VALUE        : BankName                : ##AnkChequeBank
        424    :               SET VALUE         : InstrumentNumber        : ##AnkChequeNo
        425    :               SET VALUE         : InstrumentDate        : ##AnkChequeDate
        426 :                 SET VALUE         : PaymentFavouring        : ##AnkPayFavouring
    
        460    :                 SET VALUE        : Amount                : -1 * ##AnkChequeAmount
        470    :                 SET TARGET    : ...
        471:                SET TARGET        : ..
        480    : End If
        551    : Set Value    : Narration    : ##VchNarration
        560 : SET VALUE : PersistedView : ##SVViewName
        570    : CREATE TARGET
        580    : ENDIF 
     


  2. ankur daga

    ankur daga Member


    Admins and experts pls help.
     


  3. Himanshu-2002

    Himanshu-2002 Active Member


    Add This After 200

    200A: Set Value: IsInvoice: No
     


  4. ankur daga

    ankur daga Member


    Thanks Himanshu, i added this line but still the instrument date and instrument number is not reflecting in the bank payment page.
     


  5. Himanshu-2002

    Himanshu-2002 Active Member


    Add This Line After 420
    421: Set Value: Name: $$MakeUniqueId
     


  6. ankur daga

    ankur daga Member


    Thanks Himanshu,

    I used following

    Code:
    [Function: PaymentVchCreatebank]
        Variable    : BankLedger    : String
        Variable    : AnkChequeAmount    : Amount
        Variable    : AnkChequeBank    : String
        Variable    : AnkChequeNo        : String
        Variable    : AnkChequeDate    : Date
        Variable    :AnkPayFavouring:String
        Variable    : VchType        : String
        Variable    : VchCostCentre    : String
        Variable    : VchDate        : Date  
        Variable    : VchNarration    : String
        Variable    : VCHAmount        : Amount
        Variable    : VCHNumber        : String
    
        040    : Set    : BankLedger    : $POSChequeLedger
        050    : Set    : AnkChequeAmount    : $PayPOSBankAmount
        060    : Set    : AnkChequeBank    : $POSChequeBankName
        070    : Set    : AnkChequeNo        : $POSChequeNumber
        080    : Set    : AnkChequeDate    : $POSChequeDate
        090 : Set    : AnkPayFavouring:$PartyLedgerName1
        110    : Set    : VchType        : $$VchTypePayment
        115    : Set    : VchCostCentre    : $AutoCostLevel
              
        120    : SET    : VchDate        : $DATE
        130 : SET     : VCHAmount        :  ##AnkChequeAmount
        140 : SET    : VchNarration    : "Bill No.: " + $$String:$VoucherNumber
        141    : Set    : VCHNumber        : $VoucherNumber
    
        150 : QUERYBOX : "Create CHEQUE Payment Voucher ?":Yes:No
    
        160    : IF : $$LastResult
        170    : NEW OBJECT : VOUCHER
        180    :   SET VALUE    : Date                        : ##VchDate
        185    :   Set Value    : AUTOCOSTLEVEL                : ##VchCostCentre
        190    :   SET VALUE    : VoucherTypeName            : ##VchType
        200 :   SET         : SVViewName                : $$SysName:AcctgVchView
    200A: Set Value: IsInvoice: No
        210    :         INSERT COLLECTION OBJECT                : AllLedgerEntries
        220    :        SET VALUE        : LedgerName            : $PartyLedgerName
        230    :         SET VALUE        : Amount                : -1 * ##VCHAmount
        240    :         SET VALUE        : Is Deemed Positive    : "Yes"
    
        250    :             INSERT COLLECTION OBJECT                : BillAllocations
        260    :                SET VALUE        : Name                    : ##VCHNumber
        270    :               SET VALUE         : BillType                : "AgstRef"
        280    :                 SET VALUE        : Amount                : -1 * ##VCHAmount
        290    :                 SET TARGET        : ...
    
        370    : If    : NOT $$IsSysName:##BankLedger
        380    :       INSERT COLLECTION OBJECT                : LedgerEntries
        390    :        SET VALUE        : LedgerName            : ##BankLedger
        400    :         SET VALUE        : Amount                : -1 * ##AnkChequeAmount
        410    :         SET VALUE        : Is Deemed Positive    : "No"
      
        420    :             INSERT COLLECTION OBJECT                : BankAllocations ;; This section values are not getting reflected in the payment bank
    421: Set Value: Name: $$MakeUniqueId
        422 :                 SET VALUE         : TransactionType         : $$Sysname:ChequeDD ; this not reflecting
        423    :                SET VALUE        : BankName                : ##AnkChequeBank  ; this not reflecting
        424    :               SET VALUE         : InstrumentNumber        : ##AnkChequeNo  ; this not reflecting
        425    :               SET VALUE         : InstrumentDate        : ##AnkChequeDate  ; this not reflecting
        426 :                 SET VALUE         : PaymentFavouring        : ##AnkPayFavouring  ; this not reflecting
    
        460    :                 SET VALUE        : Amount                : -1 * ##AnkChequeAmount
        470    :                 SET TARGET    : ...
        471:                SET TARGET        : ..
        480    : End If
        551    : Set Value    : Narration    : ##VchNarration
        560 : SET VALUE : PersistedView : ##SVViewName
        570    : CREATE TARGET
        580    : ENDIF
    
    But still not getting the Bank details in the payment voucher.
    Pls Help
     


  7. ankur daga

    ankur daga Member


    Please Help
     


  8. Himanshu-2002

    Himanshu-2002 Active Member


    Can we connect via anydesk today ?
     


  9. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    Insert Every Details For Bank Allocation.
    Like MakeUniqueid etc.
     


  10. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    It is Better to Use ChequeDD in Bank Allocation instead of Cheque.
     


  11. Jenny

    Jenny Active Member


    ;Bank Allocation
    201 : IF : ($$IsLedOfGrp:$PartyLedgerName:$$GroupBank OR $$IsLedOfGrp:$SalesLedgerName:$$GroupBank)
    202 : INSERT COLLECTION OBJECT : BANKALLOCATIONS
    202a : Set Target: BANKALLOCATIONS
    203 : SET VALUE : DATE : $$Date:$Date
    204 : SET VALUE : INSTRUMENTDATE : $$Date:$Date
    205 : SET VALUE : NAME : $$MakeUniqueID
    206 : SET VALUE : TRANSACTIONTYPE : "Cheque"
    207 : SET VALUE : BANKNAME : ""
    208 : SET VALUE : PAYMENTMODE : "Transacted"
    209 : SET VALUE : INSTRUMENTNUMBER :##AnkChequeNo
    210 : SET VALUE : AMOUNT : $$AsAmount:$Amount
    211 : End If
    212 : SET TARGET : ..
     


Share This Page