Transaction on voucher do not balance as per date in general ledger

Hi,

I have pay and transfer the cash advance request to GL  on the lines of that particular jounrla number when i valide the general  system show me an error

" The transaction on voucher <Voucher Num> do not balance as per date 1/31/2017 (accounting currency <some> reporting currency <some> ) "

Attach the screen shot of transactions.

  • 1. Check the sum of credit and debit - they should sum to zero.
    2. Check there are no issues with the currency and exchange rates on the these transactions.
  • In reply to Kranthi:

    Thanks for reply , Yes there is difference in balance

    Total credit journal : 173350 per voucher : 0
    total debit : journal : 173350 per voucher : 9450

    balance : journal : journal : 0 per voucher : 9450

    how can i solve this
  • In reply to SalmanHafeez:

    It seems they have different voucher number. They all should have same voucher number.
  • In reply to Kranthi:

    How i can get previous voucher number of same journal num and enter into new line

    I am trying to get like this but on the entry of secod transaction in ledger journal trans it show me an error "Number sequnece 0 does not exist"

    Here is my code

    info(strFmt("journal num %1", _table.JournalNum));
    while select * from trans
    where trans.JournalNum == _table.JournalNum
    {
    voucher = trans.Voucher;
    info(strFmt("voucher num %1", voucher));
    }
    if(voucher == '')
    {
    info(strFmt("voucher == null %1", voucher));
    trvLedgerInfo = TrvLedgerInfo::construct(_record.TableId, _record.RecId, NumberSequenceTable::find(_table.NumberSequenceTable).NumberSequence,'');
    }
    else
    {
    info("voucher != null");
    trvLedgerInfo = TrvLedgerInfo::construct(_record.TableId, _record.RecId, NumberSequenceTable::find(_table.NumberSequenceTable).NumberSequence,voucher);
    }

    public static TrvLedgerInfo construct(tableId _tableId, recId _recId, NumberSequenceCode _voucherSeries = '',NumberSequenceCode _voucher = '', boolean _ignoreParameter = false)
    {
    TrvLedgerInfo trvLedgerInfo = new TrvLedgerInfo();

    trvLedgerInfo.parmTableId(_tableId);
    trvLedgerInfo.parmRecId(_recId);
    //phc
    if(_voucher == '')
    {
    info(strFmt("Contruct voucher == null %1", _voucher));
    trvLedgerInfo.parmVoucherSeries(_voucherSeries);
    }
    else
    {
    info(" Construct voucher != null %1");
    trvLedgerInfo.parmVoucherSeries(_voucher);
    }
    // trvLedgerInfo.parmVoucherSeries(_voucherSeries);
    trvLedgerInfo.parmIgnoreParameter(_ignoreParameter);

    switch(_tableId)
    {
    case tableNum(TrvCashAdvance):
    trvLedgerInfo.setCashAdvanceParms();
    break;
    }

    // set payment info if either of the accounts contains vendor account
    trvLedgerInfo.setPayment();

    return trvLedgerInfo;
  • In reply to SalmanHafeez:

    Not sure what you are trying with this code. How this journal has been created?
  • In reply to Kranthi:

    TrvPost is the class name in which is called on pay and transfer of cash advance. i have done customization in this class.
  • In reply to SalmanHafeez:

    How this class is related to journal voucher issue (stated above)? I will be difficult to help you, if you are not providing the enough details.

  • In reply to Kranthi:

    Before customization this class create only one journal batch with one voucher on the click on pay and transfer against one cash advance but client requirement was that they can pay and transfer the multi-select cash advance and only one journal batch will be created against those multi-select cash advance.. then i customize this class now only one journal batch is created with selected multiple cash advance but system create a different voucher number against every line.
    My code structure is that : in Main method if table is cash advance then first i call the CreateLedgerJournal method which create a one Batch in general journal with specific journal number after this i call a PostMultiple method and in this method i have called a Post method in which a voucher and lines insert in ledger journal trans
  • In reply to SalmanHafeez:

    Have you tried to debug? It may not be possible to say without knowing your code.
  • In reply to Kranthi:

    i can send you my customized code into your personal email. if u provide me your email account
  • In reply to SalmanHafeez:

    yes i have debug it happened because the voucher generation code is written into CreateLedgerJournalTrans method. That's why it always make new voucher against every cash advance line.
  • In reply to SalmanHafeez:

    They are standard classes, so you may put your changes here and tell us how you are calling it.
  • In reply to Kranthi:

    Ihave done customization in the Cash Advance Portion of Every method :

    Main Method of TrvPost Class : In main method in the IF portion of cash advance First i journal header then i called post multiple method

    public static void main(Args args)
    {
    TrvLedgerJournalDialog ledgerJournalDialog;
    LedgerJournalTable ledgerJournalTable = null;
    Object callerObject;
    FormDataSource cashAdv_ds;
    Name description;

    callerObject = args.caller();
    cashAdv_ds = args.record().dataSource();
    //datasource.
    // Cash advance posting
    if(callerObject.name() == formStr(TrvCashAdvanceAdmin) ||
    callerObject.name() == formStr(TrvCashAdvancesListPage) )
    {
    ledgerJournalDialog = TrvLedgerJournalDialog::construct(strFmt("@SYS117457"));
    ledgerJournalDialog.run();

    if(ledgerJournalDialog.parmIsClosedOK())
    {
    /*TrvPost::post(args.record(),
    ledgerJournalDialog.parmJournalName(),
    ledgerJournalDialog.parmJournalId(),
    ledgerJournalDialog.parmPostingDate(),
    true);*/

    //PHC
    description = strFmt(" Cash Advance Posted on %1",ledgerJournalDialog.parmPostingDate());
    ledgerJournalTable = TrvCreateLedger::createLedgerJournal( ledgerJournalDialog.parmJournalName(),
    ledgerJournalDialog.parmJournalId(),
    description,
    ledgerJournalDialog.parmPostingDate());


    TrvPost::postMultiple(cashAdv_ds,ledgerJournalTable,
    ledgerJournalDialog.parmJournalName(),
    ledgerJournalDialog.parmJournalId(),
    ledgerJournalDialog.parmPostingDate());
    }
    }

    }

    MultiplePost Mthod : which is called in Main Method

    public static void postMultiple(FormDataSource _formDataSource ,LedgerJournalTable _table = null,
    LedgerJournalNameId _journalname ='',
    LedgerJournalId _journalid='',
    TransDate _postingdate = dateNull(),
    boolean _all = false)
    {
    Common buffer;
    ;

    if(!_all)
    {
    for (buffer = _formDataSource.getFirst(true) ? _formDataSource.getFirst(true) : _formDataSource.cursor(); buffer; buffer = _formDataSource.getNext())
    {
    TrvPost::post(buffer,_table,
    _journalname,
    _journalid,
    _postingdate,
    true);
    info(strFmt("test1 %1",_postingdate));
    }
    }
    else // Post everything that's visible in the GRID
    {
    buffer = _formDataSource.getFirst();
    while(buffer)
    {
    TrvPost::post(buffer,_table,
    _journalname,
    _journalid,
    _postingdate,
    true);
    // info(strFmt("test2 %1",_journalid));
    buffer = _formDataSource.getNext();
    }
    }

    _formDataSource.reread();
    }

    Post Method which is called in Multiple Post :

    static void post(Common _record,LedgerJournalTable _table = null,
    LedgerJournalNameId _journalName = '',
    LedgerJournalId _journalId = '',
    TransDate _transDate = dateNull(),
    boolean _calledFromUI = false)
    {

    LedgerJournalTable ledgerJournalTable = null;

    LedgerJournalTable ledgerJournalTableWTax = null;
    LedgerJournalTrans ledgerJournalTrans,trans,ledgerjtrans,ledgertrans;
    NumberSequenceCode voucher;
    TrvLedgerInfo trvLedgerInfo;
    TrvCashAdvance trvCashAdvance;
    TrvExpTrans trvExpTrans;
    TrvExpTable trvExpTable;
    Name description;
    Args args;
    boolean ignoreParameter = false;
    boolean taxIncluded = false;
    TrvParameters trvParameters = TrvParameters::find();

    int numberOfRecoveryTasks = 0;
    TrvExpenseTaxRecovery trvExpenseTaxRecovery;
    TrvExpTrans trvExpTransTmp;
    TrvExpNumber trvExpNumber;

    TrvPostExpenseHeader trvPostExpenseHeader;
    TrvPostExpenseLine trvPostExpenseLine;



    switch(_record.TableId)
    {
    case tableNum(TrvCashAdvance):
    trvCashAdvance = _record;

    if (_calledFromUI)
    {
    // if call from UI then we need to retrive the record because the form data source may
    // have not retrive all of the fields.
    trvCashAdvance = TrvCashAdvance::findRecId(trvCashAdvance.RecId, true);
    }

    description = strFmt("@SYS117456", trvCashAdvance.CashAdvanceNumber);

    // Create LedgerTable record
    /* ledgerJournalTable = TrvCreateLedger::createLedgerJournal(_journalName,
    _journalId,
    description,
    _transDate);*/
    trvLedgerInfo = TrvLedgerInfo::construct(_record.TableId, _record.RecId, NumberSequenceTable::find(_table.NumberSequenceTable).NumberSequence);

    // trvLedgerInfo = TrvLedgerInfo::construct(_record.TableId, _record.RecId, NumberSequenceTable::find(ledgerJournalTable.NumberSequenceTable).NumberSequence);


    // trvLedgerInfo.parmJournalId(ledgerJournalTable.JournalNum);
    trvLedgerInfo.parmJournalId(_table.JournalNum);
    trvLedgerInfo.parmTransDate(_transDate);

    ledgerjtrans = TrvCreateLedger::createLedgerJournalTrans(trvLedgerInfo);


    // Update TrvCashAdvance Posting Information
    /* trvCashAdvance.Balance = trvCashAdvance.PaidAmountCur;
    trvCashAdvance.BalanceMST = trvCashAdvance.PaidAmountMST;
    trvCashAdvance.CashAdvanceStatus = TrvWorkflowCashAdvanceStatus::Paid;
    trvCashAdvance.PaidDate = _transDate;
    trvCashAdvance.PayingWorker = HcmWorker::userId2Worker(curUserId());

    ttsbegin;
    trvCashAdvance.doUpdate();
    ttscommit;
    */
    break;



    }


    }
Related
Recommended