use of com.axelor.apps.account.db.Move in project axelor-open-suite by axelor.
the class MoveController method isHiddenMoveLineListViewer.
public void isHiddenMoveLineListViewer(ActionRequest request, ActionResponse response) {
Move move = request.getContext().asType(Move.class);
boolean isHidden = true;
try {
if (move.getMoveLineList() != null && move.getStatusSelect() < MoveRepository.STATUS_VALIDATED) {
for (MoveLine moveLine : move.getMoveLineList()) {
if (moveLine.getAmountPaid().compareTo(BigDecimal.ZERO) > 0 || moveLine.getReconcileGroup() != null) {
isHidden = false;
}
}
}
response.setAttr("$reconcileTags", "hidden", isHidden);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.account.db.Move in project axelor-open-suite by axelor.
the class MoveController method computeTotals.
public void computeTotals(ActionRequest request, ActionResponse response) {
Move move = request.getContext().asType(Move.class);
try {
Map<String, Object> values = Beans.get(MoveService.class).computeTotals(move);
response.setValues(values);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.account.db.Move in project axelor-open-suite by axelor.
the class MoveController method updateInDayBookMode.
public void updateInDayBookMode(ActionRequest request, ActionResponse response) {
Move move = request.getContext().asType(Move.class);
move = Beans.get(MoveRepository.class).find(move.getId());
try {
if (move.getStatusSelect() == MoveRepository.STATUS_ACCOUNTED) {
Beans.get(MoveService.class).getMoveValidateService().updateInDayBookMode(move);
response.setReload(true);
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.account.db.Move in project axelor-open-suite by axelor.
the class MoveController method generateReverse.
public void generateReverse(ActionRequest request, ActionResponse response) {
try {
Context context = request.getContext();
Move move = context.asType(Move.class);
move = Beans.get(MoveRepository.class).find(move.getId());
Map<String, Object> assistantMap = Beans.get(ExtractContextMoveService.class).getMapFromMoveWizardGenerateReverseForm(context);
Move newMove = Beans.get(MoveService.class).generateReverse(move, assistantMap);
if (newMove != null) {
response.setView(ActionView.define(I18n.get("Account move")).model("com.axelor.apps.account.db.Move").add("grid", "move-grid").add("form", "move-form").param("forceEdit", "true").context("_showRecord", newMove.getId().toString()).map());
response.setCanClose(true);
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.account.db.Move in project axelor-open-suite by axelor.
the class MoveController method validate.
public void validate(ActionRequest request, ActionResponse response) {
Move move = request.getContext().asType(Move.class);
move = Beans.get(MoveRepository.class).find(move.getId());
try {
Beans.get(MoveService.class).getMoveValidateService().validate(move);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e, ResponseMessageType.ERROR);
}
}
Aggregations