Blog Listem

8 Ağustos 2017 Salı

AX 2012 - Dönem kapanış kontrolü

Muhasebe için:

FiscalCalendars::checkModuleIsOpen(SysModule::Ledger, myTable.TransDate,FiscalCalendars::findPeriodByPeriodCodeDate(Ledger::fiscalCalendar(CompanyInfo::find().RecId),myTable.ETGTransDate),false)

veya

select firstOnly period
        where transDate >= period.StartDate  && transDate <= period.EndDate
            exists join ledgerPeriod
                where ledgerPeriod.FiscalCalendarPeriod == period.RecId &&
                      ledgerPeriod.Status != FiscalPeriodStatus::Open;
    if (period.RecId != 0)
        throw error("Yeni tarih için ilgili mali dönem kapalı!..");

Satış için:

FiscalCalendars::checkModuleIsOpen(SysModule::Sales, CustInvoiceJour.InvoiceDate,FiscalCalendars::findPeriodByPeriodCodeDate(Ledger::fiscalCalendar(CompanyInfo::find().RecId),CustInvoiceJour.InvoiceDate),false)

Stok kapanışı için:

InventClosing::findClosingDate(endmth(InventJournalTrans.TransDate))

Hiç yorum yok:

Yorum Gönder