use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class ProjectPlanningTimeHRRepository method remove.
@Override
public void remove(ProjectPlanningTime projectPlanningTime) {
Project project = projectPlanningTime.getProject();
ProjectTask task = projectPlanningTime.getProjectTask();
super.remove(projectPlanningTime);
if (task != null) {
projectTaskRepo.save(task);
} else {
projectRepo.save(project);
}
}
use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class ProjectTaskHRRepository method copy.
@Override
public ProjectTask copy(ProjectTask entity, boolean deep) {
ProjectTask task = super.copy(entity, deep);
task.setTotalPlannedHrs(null);
task.setTotalRealHrs(null);
task.clearProjectPlanningTimeList();
return task;
}
use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class InvoicePaymentValidateProjectServiceImpl method validate.
@Override
@Transactional(rollbackOn = { Exception.class })
public void validate(InvoicePayment invoicePayment, boolean force) throws AxelorException, JAXBException, IOException, DatatypeConfigurationException {
super.validate(invoicePayment, force);
Invoice invoice = invoicePayment.getInvoice();
InvoicingProject invoicingProject = invoicingProjectRepo.all().filter("self.invoice.id = ?1 AND self.project.invoicingSequenceSelect = ?2", invoice.getId(), ProjectRepository.INVOICING_SEQ_INVOICE_PRE_TASK).fetchOne();
if (invoicingProject != null) {
for (ProjectTask projectTask : invoicingProject.getProjectTaskSet()) {
projectTask.setIsPaid(invoice.getHasPendingPayments());
}
}
}
use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class InvoiceProjectRepository method remove.
@Override
public void remove(Invoice entity) {
if (Beans.get(AppBusinessProjectService.class).isApp("business-project")) {
List<InvoicingProject> invoiceProjectList = Beans.get(InvoicingProjectRepository.class).all().filter("self.invoice.id = ?", entity.getId()).fetch();
List<ProjectTask> projectTaskList = Beans.get(ProjectTaskRepository.class).all().filter("self.invoiceLine.invoice = ?1", entity).fetch();
if (ObjectUtils.notEmpty(projectTaskList)) {
for (ProjectTask projectTask : projectTaskList) {
projectTask.setInvoiceLine(null);
}
}
for (InvoicingProject invoiceProject : invoiceProjectList) {
invoiceProject.setInvoice(null);
invoiceProject.setStatusSelect(InvoicingProjectRepository.STATUS_DRAFT);
}
}
super.remove(entity);
}
use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class ProjectTaskBusinessProjectRepository method copy.
@Override
public ProjectTask copy(ProjectTask entity, boolean deep) {
ProjectTask task = super.copy(entity, deep);
task.setSaleOrderLine(null);
task.setInvoiceLine(null);
return task;
}
Aggregations