|
|||||||
CreateAccruals
Время создания: 20.09.2019 09:22
Раздел: INFO - JOB - CUBA - GroovyScripts
Запись: wwwlir/Tetra/master/base/1568701114foco3wzpfc/text.html на raw.githubusercontent.com
|
|||||||
|
|||||||
import com.haulmont.cuba.core.global.*; import com.groupstp.rtneo.entity.*; import com.groupstp.rtneo.core.bean.calculation.*; import java.util.*; import com.groupstp.rtneo.service.*; import java.text.SimpleDateFormat; SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy") Date fromDate = format.parse("01.01.2019") Date beforeDate = format.parse("31.12.2019") Date contract_date = format.parse("01.01.2019") def contragentId = 'f9529f85-2157-42e0-0e4f-9923fc6a40ec'; def contragent = dataManager.load(Contragent.class).id(UUID.fromString(contragentId)).view('contragent-calculations').optional().orElse(null); def calculationWorker = AppBeans.get(CalculationWorkerBean.class); //com.groupstp.rtneo.core.bean.calculation.CalculationWorkerBean#calculateAccruals //def accruals = calculationWorker.calculateAccruals(fromDate,beforeDate,contragent,contract_date); // //for(accrual in accruals){ // log.debug("${accrual.getPeriod()} "); //} //com.groupstp.rtneo.core.bean.calculation.CalculationWorkerBean#recalculate //def accrualsOld = dataManager.load(Accrual) // .query('select a from rtneo$Accrual a where a.contragent.id = :contragentId order by a.period') // .parameter("contragentId", contragent.getId()) // .view('accrual-full') // .list() // //for(accrual in accrualsOld){ // log.debug("${accrual.getPeriod()} ${accrual.getId()}"); //} //log.debug(accrualsOld[0]) //calculationWorker.recalculate(accrualsOld[0]); //com.groupstp.rtneo.service.AccrualServiceBean#makeAccrual //public void makeAccrual(Date dateFrom, Date dateTo, Contragent contragent, Date billDate, Boolean fullAccess) def accrualService = AppBeans.get(AccrualService.NAME); accrualService.makeAccrual(fromDate,beforeDate,contragent,contract_date, true); //=========================================================================================// def accrualsOld = dataManager.load(Accrual) .query('select a from rtneo$Accrual a where a.contragent.id = :contragentId order by a.period') .parameter("contragentId", contragent.getId()) .view('accrual-full') .list() for(accrual in accrualsOld){ log.debug("${accrual.getPeriod()} ${accrual.getId()}"); } |
|||||||
Так же в этом разделе:
|
|||||||
|
|||||||
|