code: @Override
    public final void makeFirstPrepareForSave(final Map<String, Object> pAddParam,
      final PaymentFrom pEntity,
        final IRequestData pRequestData) throws Exception {
      //BeigeORM refresh:
      pEntity.setAccCash(getSrvOrm()
        .retrieveEntity(pAddParam, pEntity.getAccCash()));
      if (pEntity.getAccCash().getSubaccType() != null
        && pEntity.getSubaccCashId() == null) {
        throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
          "select_subaccount");
      }
      if (pEntity.getSalesInvoice() != null) {
        SalesInvoice salesInvoice = getSrvOrm()
          .retrieveEntity(pAddParam, pEntity.getSalesInvoice());
        if (!salesInvoice.getHasMadeAccEntries()
          || salesInvoice.getReversedId() != null) {
          throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER,
            "sales_invoice_must_be_accounted");
        }
        pEntity.setSalesInvoice(salesInvoice);
      }
    }
docs: <p>Make save preparations before insert/update block if it's need.</p>
  @param pAddParam additional param
  @param pEntity entity
  @param pRequestData Request Data
  @throws Exception - an exception