French cheque when printing Invoice : cancel validation of ledger journal

You maybe need to print a cheque for a French customer BUT when you set the parameters for do that, a new ledger journal is created AND validate !

You maybe don’t want of this fonction.

For stop this processus, you must modify the class : CustVendPaymInvoiceWithJournal. And you must create a new method et modify the method run()

void myDeleteJournal()
{
    LedgerJournalTable      ledgerJournalTableToDelete;
    LedgerJournalTrans      ledgerJournalTrans;
    ;

    ttsbegin;

    //  Change status of line
    while select forupdate ledgerJournalTrans
    where ledgerJournalTrans.JournalNum     == ledgerJournalTable.JournalNum
    {
        ledgerJournalTrans.PaymentStatus = CustVendPaymStatus::None;
        ledgerJournalTrans.update();
    }

    //  Delete the lines
    while select forupdate ledgerJournalTrans
    where ledgerJournalTrans.JournalNum     == ledgerJournalTable.JournalNum
    {
        ledgerJournalTrans.delete();
    }

    //  Delete the journal
    select forupdate firstonly ledgerJournalTableToDelete
    where ledgerJournalTableToDelete.JournalNum == ledgerJournalTable.JournalNum;

    ledgerJournalTableToDelete.delete();

    ttscommit;
}
void run()
{
    setprefix("@SYS17561");

    try
    {
        if (!paymModeTable.PaymJournalNameId)
            throw error("@SYS16764");

        ttsbegin;
        this.createJournal();
        this.createPayment();
        ttscommit;
        this.generatePayment();
// MY NEW CODE - BEGIN
//        this.postJournal();
        switch (this.parmCustVendInvoiceJour().module())
        {
            case SysModule::Cust, SysModule::Project :
                    this.myDeleteJournal();
                    break;

            default :
                    this.postJournal();
                    break;
        }
// MY NEW CODE - END
    }

    catch (Exception::Error)
    {
        info ("@SYS83591");
    }
}