use of com.axelor.apps.hr.db.PayrollPreparation in project axelor-open-suite by axelor.
the class PayrollPreparationController method fillInPayrollPreparation.
public void fillInPayrollPreparation(ActionRequest request, ActionResponse response) throws AxelorException {
PayrollPreparation payrollPreparation = request.getContext().asType(PayrollPreparation.class);
List<PayrollLeave> payrollLeaveList = Beans.get(PayrollPreparationService.class).fillInPayrollPreparation(payrollPreparation);
response.setValue("extraHoursLineList", payrollPreparation.getExtraHoursLineList());
response.setValue("$payrollLeavesList", payrollLeaveList);
response.setValue("duration", payrollPreparation.getDuration());
response.setValue("leaveDuration", payrollPreparation.getLeaveDuration());
response.setValue("expenseAmount", payrollPreparation.getExpenseAmount());
response.setValue("expenseList", payrollPreparation.getExpenseList());
response.setValue("otherCostsEmployeeSet", payrollPreparation.getEmploymentContract().getOtherCostsEmployeeSet());
response.setValue("annualGrossSalary", payrollPreparation.getEmploymentContract().getAnnualGrossSalary());
response.setValue("employeeBonusMgtLineList", payrollPreparation.getEmployeeBonusMgtLineList());
response.setValue("lunchVoucherNumber", payrollPreparation.getLunchVoucherNumber());
response.setValue("lunchVoucherMgtLineList", payrollPreparation.getLunchVoucherMgtLineList());
response.setValue("employeeBonusAmount", payrollPreparation.getEmployeeBonusAmount());
response.setValue("extraHoursNumber", payrollPreparation.getExtraHoursNumber());
}
use of com.axelor.apps.hr.db.PayrollPreparation in project axelor-open-suite by axelor.
the class BatchPayrollPreparationExport method nibelisExport.
@Transactional(rollbackOn = { Exception.class })
public MetaFile nibelisExport(List<PayrollPreparation> payrollPreparationList) throws IOException, AxelorException {
List<String[]> list = new ArrayList<>();
for (PayrollPreparation payrollPreparation : payrollPreparationList) {
payrollPreparation.addBatchListItem(batch);
payrollPreparationService.exportNibelis(payrollPreparation, list);
total++;
}
String fileName = Beans.get(PayrollPreparationService.class).getPayrollPreparationExportName();
File file = MetaFiles.createTempFile(fileName, ".csv").toFile();
CsvTool.csvWriter(file.getParent(), file.getName(), ';', Beans.get(PayrollPreparationService.class).getPayrollPreparationMeilleurGestionExportHeader(), list);
FileInputStream inStream = new FileInputStream(file);
MetaFile metaFile = Beans.get(MetaFiles.class).upload(inStream, file.getName());
return metaFile;
}
use of com.axelor.apps.hr.db.PayrollPreparation in project axelor-open-suite by axelor.
the class BatchPayrollPreparationExport method standardExport.
@Transactional(rollbackOn = { Exception.class })
public MetaFile standardExport(List<PayrollPreparation> payrollPreparationList) throws IOException {
List<String[]> list = new ArrayList<>();
LocalDate today = Beans.get(AppBaseService.class).getTodayDate(hrBatch.getCompany());
for (PayrollPreparation payrollPreparation : payrollPreparationList) {
String[] item = new String[5];
item[0] = payrollPreparation.getEmployee().getName();
item[1] = payrollPreparation.getDuration().toString();
item[2] = payrollPreparation.getLunchVoucherNumber().toString();
item[3] = payrollPreparation.getEmployeeBonusAmount().toString();
item[4] = payrollPreparation.getExtraHoursNumber().toString();
list.add(item);
payrollPreparation.setExported(true);
payrollPreparation.setExportDate(today);
payrollPreparation.setExportTypeSelect(HrBatchRepository.EXPORT_TYPE_STANDARD);
payrollPreparation.addBatchListItem(batch);
payrollPreparationRepository.save(payrollPreparation);
total++;
incrementDone();
}
String fileName = Beans.get(PayrollPreparationService.class).getPayrollPreparationExportName();
File file = MetaFiles.createTempFile(fileName, ".csv").toFile();
CsvTool.csvWriter(file.getParent(), file.getName(), ';', Beans.get(PayrollPreparationService.class).getPayrollPreparationExportHeader(), list);
FileInputStream inStream = new FileInputStream(file);
MetaFile metaFile = Beans.get(MetaFiles.class).upload(inStream, file.getName());
return metaFile;
}
use of com.axelor.apps.hr.db.PayrollPreparation in project axelor-open-suite by axelor.
the class BatchPayrollPreparationExport method silaeExport.
@Transactional(rollbackOn = { Exception.class })
public MetaFile silaeExport(List<PayrollPreparation> payrollPreparationList) throws IOException, AxelorException {
List<String[]> list = new ArrayList<>();
for (PayrollPreparation payrollPreparation : payrollPreparationList) {
payrollPreparation.addBatchListItem(batch);
payrollPreparationService.exportSilae(payrollPreparation, list);
total++;
incrementDone();
}
String fileName = payrollPreparationService.getPayrollPreparationExportName();
File file = MetaFiles.createTempFile(fileName, ".csv").toFile();
CsvTool.csvWriter(file.getParent(), file.getName(), ';', payrollPreparationService.getPayrollPreparationSilaeExportHeader(), list);
FileInputStream inStream = new FileInputStream(file);
MetaFile metaFile = Beans.get(MetaFiles.class).upload(inStream, file.getName());
return metaFile;
}
use of com.axelor.apps.hr.db.PayrollPreparation in project axelor-open-suite by axelor.
the class PayrollPreparationController method fillInPayrollPreparationLeaves.
public void fillInPayrollPreparationLeaves(ActionRequest request, ActionResponse response) throws AxelorException {
PayrollPreparation payrollPreparation = request.getContext().asType(PayrollPreparation.class);
List<PayrollLeave> payrollLeaveList = Beans.get(PayrollPreparationService.class).fillInLeaves(payrollPreparation);
response.setValue("$payrollLeavesList", payrollLeaveList);
}
Aggregations