Ejemplo n.º 1
0
  @Override
  public void actionRowEdit(boolean showSystemRegistries) {
    SDbBankLayout bankLayout = null;

    if (jbRowEdit.isEnabled()) {
      if (jtTable.getSelectedRowCount() != 1) {
        miClient.showMsgBoxInformation(SGridConsts.MSG_SELECT_ROW);
      } else {
        SGridRowView gridRow = (SGridRowView) getSelectedGridRow();
        SGuiParams params = null;

        if (gridRow.getRowType() != SGridConsts.ROW_TYPE_DATA) {
          miClient.showMsgBoxWarning(SGridConsts.ERR_MSG_ROW_TYPE_DATA);
        } else if (!showSystemRegistries && gridRow.isRowSystem()) {
          miClient.showMsgBoxWarning(
              SDbConsts.MSG_REG_ + gridRow.getRowName() + SDbConsts.MSG_REG_IS_SYSTEM);
        } else if (!gridRow.isUpdatable()) {
          miClient.showMsgBoxWarning(
              SDbConsts.MSG_REG_ + gridRow.getRowName() + SDbConsts.MSG_REG_NON_UPDATABLE);
        } else if (moPaneSettings.isUserInsertApplying()
            && mnUserLevelAccess == SUtilConsts.LEV_AUTHOR
            && gridRow.getFkUserInsertId() != miClient.getSession().getUser().getPkUserId()) {
          miClient.showMsgBoxWarning(SDbConsts.MSG_REG_DENIED_RIGHT);
        } else {
          bankLayout =
              (SDbBankLayout)
                  miClient
                      .getSession()
                      .readRegistry(
                          SModConsts.FIN_LAY_BANK,
                          gridRow.getRowPrimaryKey(),
                          SDbConsts.MODE_VERBOSE);

          if (bankLayout.getLayoutStatus() == SFinConsts.LAY_BANK_APPROVED_ST) {
            miClient.showMsgBoxWarning(
                "El layout no puede ser modificado en estatus "
                    + SFinConsts.LAY_BANK_APPROVED_TEXT_ST);
          } else if (bankLayout.getDocsPayed() > 0) {
            miClient.showMsgBoxWarning(
                SDbConsts.MSG_REG_DENIED_UPDATE + "\n¡Existen documentos con pagos aplicados!");
          } else if (bankLayout.getTransfersPayed() > 0) {
            miClient.showMsgBoxWarning(
                SDbConsts.MSG_REG_DENIED_UPDATE + "\n¡Existen transferencias con pagos aplicados!");
          } else {
            params = moFormParams != null ? moFormParams : new SGuiParams();
            params.setKey(gridRow.getRowPrimaryKey());

            miClient
                .getSession()
                .getModule(mnModuleType, mnModuleSubtype)
                .showForm(mnGridType, mnGridSubtype, params);
            moFormParams = null;
          }
        }
      }
    }
  }
Ejemplo n.º 2
0
  private void actionShowCardex() {
    if (jbCardex.isEnabled()) {
      if (jtTable.getSelectedRowCount() != 1) {
        miClient.showMsgBoxInformation(SGridConsts.MSG_SELECT_ROW);
      } else {
        SGridRowView gridRow = (SGridRowView) getSelectedGridRow();

        if (gridRow.getRowType() != SGridConsts.ROW_TYPE_DATA) {
          miClient.showMsgBoxWarning(SGridConsts.ERR_MSG_ROW_TYPE_DATA);
        } else {
          moDialogLayoutsCardex.setFormParams(gridRow.getRowPrimaryKey());
          moDialogLayoutsCardex.setVisible(true);
        }
      }
    }
  }
Ejemplo n.º 3
0
 private void actionApplyPayments() {
   if (jbPayment.isEnabled()) {
     if (validateRow()) {
       SGridRowView gridRow = (SGridRowView) getSelectedGridRow();
       if (!gridRow.isUpdatable()) {
         miClient.showMsgBoxWarning(
             SDbConsts.MSG_REG_ + gridRow.getRowName() + SDbConsts.MSG_REG_NON_UPDATABLE);
       } else {
         miClient
             .getSession()
             .getModule(mnModuleType, mnModuleSubtype)
             .showForm(mnGridType, SModConsts.FIN_REC, new SGuiParams(gridRow.getRowPrimaryKey()));
       }
     }
   }
 }
Ejemplo n.º 4
0
  private SDbBankLayout readLayout() {
    SDbBankLayout bankLayout = null;

    if (jbGetLayout.isEnabled()) {
      if (validateRow()) {
        SGridRowView gridRow = (SGridRowView) getSelectedGridRow();

        bankLayout =
            (SDbBankLayout)
                miClient
                    .getSession()
                    .readRegistry(SModConsts.FIN_LAY_BANK, gridRow.getRowPrimaryKey());
      }
    }

    return bankLayout;
  }
Ejemplo n.º 5
0
  private boolean validateRow() {
    boolean valid = true;

    if (jtTable.getSelectedRowCount() != 1) {
      miClient.showMsgBoxInformation(SGridConsts.MSG_SELECT_ROW);
      valid = false;
    } else {
      SGridRowView gridRow = (SGridRowView) getSelectedGridRow();

      if (gridRow.getRowType() != SGridConsts.ROW_TYPE_DATA) {
        miClient.showMsgBoxWarning(SGridConsts.ERR_MSG_ROW_TYPE_DATA);
        valid = false;
      } else if (gridRow.isRowSystem()) {
        miClient.showMsgBoxWarning(
            SDbConsts.MSG_REG_ + gridRow.getRowName() + SDbConsts.MSG_REG_IS_SYSTEM);
        valid = false;
      }
    }

    return valid;
  }