use of com.axelor.apps.account.db.SubrogationRelease in project axelor-open-suite by axelor.
the class SubrogationReleaseController method printToPDF.
public void printToPDF(ActionRequest request, ActionResponse response) {
try {
SubrogationRelease subrogationRelease = request.getContext().asType(SubrogationRelease.class);
String name = String.format("%s %s", I18n.get("Subrogation release"), subrogationRelease.getSequenceNumber());
String fileLink = Beans.get(SubrogationReleaseService.class).printToPDF(subrogationRelease, name);
response.setView(ActionView.define(name).add("html", fileLink).map());
response.setReload(true);
} catch (Exception e) {
response.setError(e.getMessage());
TraceBackService.trace(e);
}
}
use of com.axelor.apps.account.db.SubrogationRelease in project axelor-open-suite by axelor.
the class SubrogationReleaseController method displayMoveLines.
public void displayMoveLines(ActionRequest request, ActionResponse response) {
try {
SubrogationRelease subrogationRelease = request.getContext().asType(SubrogationRelease.class);
List<Long> moveLineIdList = new ArrayList<Long>();
for (Move move : subrogationRelease.getMoveList()) {
for (MoveLine moveLine : move.getMoveLineList()) {
moveLineIdList.add(moveLine.getId());
}
}
response.setView(ActionView.define("MoveLines").model(MoveLine.class.getName()).add("grid", "move-line-grid").add("form", "move-line-form").param("search-filters", "move-line-filters").domain("self.id in (" + Joiner.on(",").join(moveLineIdList) + ")").map());
} catch (Exception e) {
response.setError(e.getMessage());
TraceBackService.trace(e);
}
}
use of com.axelor.apps.account.db.SubrogationRelease in project axelor-open-suite by axelor.
the class SubrogationReleaseController method enterReleaseInTheAccounts.
public void enterReleaseInTheAccounts(ActionRequest request, ActionResponse response) {
try {
SubrogationRelease subrogationRelease = request.getContext().asType(SubrogationRelease.class);
subrogationRelease = Beans.get(SubrogationReleaseRepository.class).find(subrogationRelease.getId());
Beans.get(SubrogationReleaseService.class).enterReleaseInTheAccounts(subrogationRelease);
response.setReload(true);
} catch (Exception e) {
response.setError(e.getMessage());
TraceBackService.trace(e);
}
}
use of com.axelor.apps.account.db.SubrogationRelease in project axelor-open-suite by axelor.
the class SubrogationReleaseController method transmitRelease.
public void transmitRelease(ActionRequest request, ActionResponse response) {
try {
SubrogationRelease subrogationRelease = request.getContext().asType(SubrogationRelease.class);
subrogationRelease = Beans.get(SubrogationReleaseRepository.class).find(subrogationRelease.getId());
Beans.get(SubrogationReleaseService.class).transmitRelease(subrogationRelease);
response.setReload(true);
} catch (Exception e) {
response.setError(e.getMessage());
TraceBackService.trace(e);
}
}
use of com.axelor.apps.account.db.SubrogationRelease in project axelor-open-suite by axelor.
the class SubrogationReleaseController method retrieveInvoices.
public void retrieveInvoices(ActionRequest request, ActionResponse response) {
try {
SubrogationRelease subrogationRelease = request.getContext().asType(SubrogationRelease.class);
Company company = subrogationRelease.getCompany();
List<Invoice> invoiceList = Beans.get(SubrogationReleaseService.class).retrieveInvoices(company);
response.setValue("invoiceSet", invoiceList);
} catch (Exception e) {
response.setError(e.getMessage());
TraceBackService.trace(e);
}
}
Aggregations