|
|||||||
Recalculate accruals
Время создания: 20.09.2019 09:22
Раздел: INFO - JOB - CUBA - GroovyScripts
Запись: wwwlir/Tetra/master/base/1568258712zfaoneyje8/text.html на raw.githubusercontent.com
|
|||||||
|
|||||||
import com.haulmont.cuba.core.global.* import com.groupstp.rtneo.entity.* import com.groupstp.rtneo.core.bean.tools.DatePeriodTools import java.text.SimpleDateFormat import com.groupstp.rtneo.core.bean.calculation.* import java.util.* import com.haulmont.cuba.core.global.ViewRepository; DataManager dataManager = AppBeans.get(DataManager.NAME); CalculationWorkerBean calculationWB = AppBeans.get(CalculationWorkerBean.NAME); String contragentId = "f9529f85-2157-42e0-0e4f-9923fc6a40ec" SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy") Date contract_date = format.parse("01.01.2019") Date fromDate = format.parse("01.01.2019") Date beforeDate = format.parse("31.12.2019") Contragent contragent = dataManager.load(Contragent.class).id(UUID.fromString(contragentId)).view('_local').one();
log.debug(contragent.getName()); List<Accrual> res = calculationWB.calculateAccruals(fromDate, beforeDate, contragent, contract_date); for(Accrual accrual:res){ log.debug(accrual); } |
|||||||
Так же в этом разделе:
|
|||||||
|
|||||||
|