use of com.axelor.apps.businessproject.db.InvoicingProject in project axelor-open-suite by axelor.
the class InvoicingProjectService method setLines.
public void setLines(InvoicingProject invoicingProject, Project project, int counter) {
if (counter > ProjectServiceImpl.MAX_LEVEL_OF_PROJECT) {
return;
}
counter++;
this.fillLines(invoicingProject, project);
if (!invoicingProject.getConsolidatePhaseWhenInvoicing()) {
return;
}
List<Project> projectChildrenList = Beans.get(ProjectRepository.class).all().filter("self.parentProject = ?1", project).fetch();
for (Project projectChild : projectChildrenList) {
this.setLines(invoicingProject, projectChild, counter);
}
return;
}
use of com.axelor.apps.businessproject.db.InvoicingProject in project axelor-open-suite by axelor.
the class InvoicingProjectServiceBusinessProdImpl method setLines.
@Override
public void setLines(InvoicingProject invoicingProject, Project project, int counter) {
AppProductionService appProductionService = Beans.get(AppProductionService.class);
if (!appProductionService.isApp("production") || !appProductionService.getAppProduction().getManageBusinessProduction()) {
super.setLines(invoicingProject, project, counter);
return;
}
if (counter > ProjectServiceImpl.MAX_LEVEL_OF_PROJECT) {
return;
}
counter++;
this.fillLines(invoicingProject, project);
if (!invoicingProject.getConsolidatePhaseWhenInvoicing()) {
return;
}
List<Project> projectChildrenList = Beans.get(ProjectRepository.class).all().filter("self.parentProject = ?1", project).fetch();
for (Project projectChild : projectChildrenList) {
this.setLines(invoicingProject, projectChild, counter);
}
return;
}
use of com.axelor.apps.businessproject.db.InvoicingProject in project axelor-open-suite by axelor.
the class WorkflowCancelServiceProjectImpl method afterCancel.
@Override
@Transactional(rollbackOn = { Exception.class })
public void afterCancel(Invoice invoice) throws AxelorException {
super.afterCancel(invoice);
InvoicingProject invoicingProject = invoicingProjectRepo.all().filter("self.invoice = ?", invoice.getId()).fetchOne();
if (invoicingProject != null) {
invoicingProject.setStatusSelect(InvoicingProjectRepository.STATUS_CANCELED);
invoicingProjectRepo.save(invoicingProject);
}
}
use of com.axelor.apps.businessproject.db.InvoicingProject in project axelor-open-suite by axelor.
the class WorkflowValidationServiceProjectImpl method afterValidation.
@Override
@Transactional(rollbackOn = { Exception.class })
public void afterValidation(Invoice invoice) throws AxelorException {
super.afterValidation(invoice);
InvoicingProject invoicingProject = invoicingProjectRepo.all().filter("self.invoice = ?", invoice.getId()).fetchOne();
if (invoicingProject != null) {
invoicingProject.setStatusSelect(InvoicingProjectRepository.STATUS_VALIDATED);
invoicingProjectRepo.save(invoicingProject);
}
}
use of com.axelor.apps.businessproject.db.InvoicingProject 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());
}
}
}
Aggregations