Показать сообщение отдельно
Старый 04.07.2009, 14:49   #12  
Vadik is offline
Vadik
Модератор
Аватар для Vadik
Лучший по профессии 2017
Лучший по профессии 2015
 
3,631 / 1850 (69) ++++++++
Регистрация: 18.11.2002
Адрес: гражданин Москвы
В KB968331 немного "ослабили поводок" (для клиентов и поставщиков)

\Classes\LedgerJournalTransUpdateCust\checkVoucher
X++:
boolean checkVoucher(LedgerJournalTrans _ledgerJournalTrans)
{
    boolean ok    = true;
    LedgerJournalTrans ledgerJournalTrans;

    if (_ledgerJournalTrans.Invoice)
    {
        //  The following rule should be applied only when the invoice number is filled in.
        //  When "Customer" type is used on any Ledger Journal Transaction it can only
        //  exist once per "Voucher" series .
        //
        //  Since a "Customer" type can be applied to either the primary or offset side
        //  of a transaction. This is both a qualifying factor and additional data to be
        //  validated. Although this only applies to "Daily" (GL) based journals it
        //  should not affect this validation.
        //
        if (_ledgerJournalTrans.AccountType       == LedgerJournalACType::Cust ||
           (_ledgerJournalTrans.OffsetAccount     &&
            _ledgerJournalTrans.OffsetAccountType == LedgerJournalACType::Cust))
        {
            ledgerJournalTrans.selectLocked(false);
            select count(RecId) from ledgerJournalTrans
            index hint NumVoucherIdx
                where ledgerJournalTrans.Voucher            == _ledgerJournalTrans.Voucher &&
                      ledgerJournalTrans.JournalNum         == _ledgerJournalTrans.JournalNum &&
                      ledgerJournalTrans.TransactionType    != LedgerTransType::Fee &&
                      (ledgerJournalTrans.AccountType       == LedgerJournalACType::Cust ||
                      (ledgerJournalTrans.OffsetAccount     &&
                       ledgerJournalTrans.OffsetAccountType == LedgerJournalACType::Cust));
            if (ledgerJournalTrans.RecId > 1)
            {
                ok = checkFailed("@SYP809");
            }
        }
    }
    return ok;
}
__________________
-ТСЯ или -ТЬСЯ ?
За это сообщение автора поблагодарили: vanokh (1).