Search in sources :

Example 1 with MHRPayrollConcept

use of org.eevolution.model.MHRPayrollConcept in project adempiere by adempiere.

the class HRCreateConcept method createPayrollConcept.

//	doIt
/**
	 * Create Payroll Concept
	 * @param concepts
	 * @param payrollId
	 * @return
	 */
private int createPayrollConcept(List<MHRConcept> concepts, int payrollId) {
    AtomicInteger count = new AtomicInteger(0);
    concepts.stream().filter(concept -> !existsPayrollConcept(concept.getHR_Concept_ID(), payrollId)).forEach(concept -> {
        MHRPayrollConcept payrollConcept = new MHRPayrollConcept(concept, payrollId, get_TrxName());
        payrollConcept.setIsPrinted(concept.isPrinted());
        payrollConcept.setSeqNo(concept.getSeqNo());
        payrollConcept.setName(concept.getName());
        payrollConcept.saveEx();
        addLog("@SeqNo@" + payrollConcept.getSeqNo() + " @HR_PayrollConcept_ID@ : " + payrollConcept.getName());
        count.updateAndGet(no -> no + 1);
    });
    return count.get();
}
Also used : List(java.util.List) Query(org.compiere.model.Query) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) MHRConcept(org.eevolution.model.MHRConcept) Optional(java.util.Optional) MHRPayrollConcept(org.eevolution.model.MHRPayrollConcept) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) MHRPayrollConcept(org.eevolution.model.MHRPayrollConcept)

Aggregations

List (java.util.List)1 Optional (java.util.Optional)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Query (org.compiere.model.Query)1 MHRConcept (org.eevolution.model.MHRConcept)1 MHRPayrollConcept (org.eevolution.model.MHRPayrollConcept)1