Examples of Dms


Examples of es.ipsa.atril.doc.user.Dms

  public String incomingDeposits(AtrilSession oSes) {
    for (Document d : getDocument().children())
      if (d.type().name().equals("IncomingDeposits"))
        return d.id();
    Dms oDms = oSes.getDms();
    Document oDoc = oDms.newDocument(oDms.getDocumentType("IncomingDeposits"), getDocument());
    oDoc.save("");
    oSes.commit();
    return oDoc.id();
  }
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

  }
 
  public QueryResultSet<BillNote> queryBillNotes(AtrilSession oSes, Boolean bOpen, String sEmployee, String sConcept, String sSearchStr, int iMaxRows, int iOffset)
    throws DocumentIndexerException {
    QueryResultSet<BillNote> aLst = new QueryResultSet<BillNote>();
    Dms oDms = oSes.getDms();
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    String sQry = DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + "BillNote AND taxpayer:\""+id()+"\"";
    if (bOpen!=null)
      sQry += " AND is_open:\""+(bOpen.booleanValue() ? "1" : "0")+"\"";
    if (sEmployee!=null) {
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

                         Boolean bOnlyOpen, BigDecimal[] aAmountRange, Integer[] aMonthsRange, Integer[] aYearsRange,
                         String sBiller, String sConcept, String sSearchStr, int iMaxRows, int iOffset)
    throws DocumentIndexerException {
    Log.out.debug("Begin TaxPayer.queryTickets("+bProcessed+","+bHasMistakes+","+bOnlyOpen+","+aAmountRange+","+aMonthsRange+","+aYearsRange+","+sBiller+","+sSearchStr+","+String.valueOf(iMaxRows)+","+String.valueOf(iOffset)+")");
    QueryResultSet<Ticket> aLst = new QueryResultSet<Ticket>();
    Dms oDms = oSes.getDms();
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    if (aAmountRange==null && aMonthsRange==null && aYearsRange==null)
      oIdx.setMaximumNumberOfDocumentReturned(iOffset+iMaxRows);
    String sQry = DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + "Ticket AND taxpayer:\""+id()+"\"";
    if (bOnlyOpen!=null)
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

  public QueryResultSet<Invoice> queryInvoices(AtrilSession oSes, Boolean bProcessed, Boolean bApproved, Boolean bHasMistakes, BigDecimal[] aAmountRange, Integer[] aMonthsRange, Integer[] aYearsRange, String sRecipient, String sBiller, String sServiceFlavor, String sSearchStr, int iMaxRows, int iOffset)
    throws DocumentIndexerException {
    Log.out.debug("Begin TaxPayer.queryInvoices("+bProcessed+","+bApproved+","+bHasMistakes+","+aAmountRange+","+aMonthsRange+","+aYearsRange+","+sBiller+","+sSearchStr+","+String.valueOf(iMaxRows)+","+String.valueOf(iOffset)+")");
    QueryResultSet<Invoice> aLst = new QueryResultSet<Invoice>();
    Dms oDms = oSes.getDms();
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    if (aAmountRange==null && aMonthsRange==null && aYearsRange==null)
      oIdx.setMaximumNumberOfDocumentReturned(iOffset+iMaxRows);

    String sQry = DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + "Invoice AND taxpayer:\""+id()+"\"";
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

      throws DmsException {
    Log.out.debug("Begin TaxPayer.queryInvoices("+bProcessed+","+bApproved+","+bHasMistakes+","+dtCreationFrom+","+dtCreationTo+","+sBiller+","+String.valueOf(iMaxRows)+","+String.valueOf(iOffset)+")");
    SimpleDateFormat oFmt = new SimpleDateFormat("yyyyMMddHHmmss");
    QueryResultSet<Invoice> aLst = new QueryResultSet<Invoice>();
   
    Dms oDms = oSes.getDms();
   
    String sQry = "";
    if (bProcessed!=null)
      sQry += "(Invoice$is_processed='"+(bProcessed.booleanValue() ? "1" : "0")+"')";
    if (bApproved!=null)
      sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$is_approved='"+(bApproved.booleanValue() ? "1" : "0")+"')";
    if (bHasMistakes!=null)
      sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$has_mistakes='"+(bHasMistakes.booleanValue() ? "1" : "0")+"')";
    if (sRecipient!=null)
      if (sRecipient.length()>0)
        sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$recipient_taxpayer='"+sRecipient+"')";
    if (sBiller!=null)
      if (sBiller.length()>0)
        sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$biller_taxpayer='"+sBiller+"')";
    if (sServiceFlavor!=null)
      if (sServiceFlavor.length()>0)
        sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$service_type='"+sServiceFlavor+"')";
    if (dtCreationFrom!=null)
      sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$creation_date>='"+oFmt.format(dtCreationFrom)+"')";
    if (dtCreationTo!=null)
      sQry += (sQry.length()==0 ? "" : " & ") + "(Invoice$creation_date<='"+oFmt.format(dtCreationTo)+"')";
    Log.out.debug("Dms.query("+sQry+")");
    SortableList<Document> oLst = oDms.query(sQry);
    if (!oLst.isEmpty()) {
      int o = 0, n = 0;
      for (Document d : oLst) {
        if (iOffset<=o++) {
          try {
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

  public void setLocale(Locale locale) { }

  public static TaxPayer create(AtrilSession oSes, CustomerAccount oAcc, String sBusinessName, String sTaxId, String sContactPerson, String sEmail, boolean bRequiresActivation, String sVolumesMountBase)
    throws NullPointerException, IllegalArgumentException, ElementNotFoundException, NotEnoughRightsException, DmsException, InstantiationException, IllegalStateException, IllegalAccessException,
         FileNotFoundException, IOException, Exception {
    Dms oDms = oSes.getDms();
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
   
    Log.out.debug("Begin TaxPayer.create("+sBusinessName+","+sTaxId+","+sEmail+String.valueOf(bRequiresActivation)+","+sVolumesMountBase+")");
   
    long lEnd, lStart = new Date().getTime();
   
    TaxPayer oPayer = new TaxPayer();
    oPayer.setDocument(oDms.newDocument(oDms.getDocumentType("TaxPayer"), oAcc.taxpayers(oSes).getDocument()));
    oPayer.put("customer_acount", oAcc.getString("account_id"));
    oPayer.put("creation_date", new Date());
    oPayer.put("active", bRequiresActivation ? "-1" : "1");
    oPayer.put("business_name", sBusinessName);
    oPayer.put("tax_id", sTaxId);
    oPayer.put("contact_person", sContactPerson);
    oPayer.put("email", sEmail);
    oPayer.save(oSes);

    oSes.commit();

    Log.out.debug("PROFILING: Save TaxPayer "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
    lStart = lEnd;
   
    Document oInvoices = oDms.newDocument(oDms.getDocumentType("Invoices"), oPayer.getDocument());
    oInvoices.save("");
    oIdx.indexDocument(oInvoices);

    Document oBillNotes = oDms.newDocument(oDms.getDocumentType("BillNotes"), oPayer.getDocument());
    oBillNotes.save("");
    oIdx.indexDocument(oBillNotes);

    Document oEmployees = oDms.newDocument(oDms.getDocumentType("Employees"), oPayer.getDocument());
    oEmployees.save("");
    oIdx.indexDocument(oEmployees);

    Log.out.debug("PROFILING: Create TaxPayer child documents "+String.valueOf((lEnd=new Date().getTime())-lStart)+" ms");
    lStart = lEnd;
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

  }

  public static void delete(AtrilSession oSes, String sDocId)
    throws DmsException, ElementNotFoundException, ClassNotFoundException, InstantiationException,
    IllegalAccessException, ClassCastException, IllegalStateException {
    Dms oDms = oSes.getDms();
    Document d = oDms.getDocument(sDocId);
    Log.out.debug("TaxPayer.delete(AtrilSession, "+sDocId+")");
    if (null==d) throw new ElementNotFoundException("Document "+sDocId+" not found");
    List <Document> oAlwed = oDms.query("AllowedTaxPayer$taxpayer='"+sDocId+"'");
    List <Document> oDnied = oDms.query("DeniedTaxPayer$taxpayer='"+sDocId+"'");
    for(Document a : oAlwed)
      BaseModelObject.delete(oSes, a.id());
    for(Document n : oDnied)
      BaseModelObject.delete(oSes, n.id());
    BaseModelObject o = new TaxPayer();
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

  public ArrayList<OrderLine> lines() {
    ArrayList<OrderLine> aLines = new ArrayList<OrderLine>();
    AtrilSession oSes = null;
    try {
      oSes = DAO.getAdminSession("Order.lines");
      Dms oDma = oSes.getDms();
      for (Document d : oDma.getDocument(id()).children())
        aLines.add(new OrderLine(oDma.getDocument(d.id())));
      oSes.disconnect();
      oSes.close();
      oSes = null;
    } finally {
      if (oSes != null) {
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

    return aLines;
  }

  public OrderLine addLine(AtrilSession oSes, Product oProd) {
    long lNextLine = 0l;
    Dms oDms = oSes.getDms();
    ArrayList<OrderLine> aLines = new ArrayList<OrderLine>();
    for (Document d : getDocument().children())
      aLines.add(new OrderLine(oDms.getDocument(d.id())));
    for (OrderLine ol : aLines)
      if (ol.getLong("line_num")>lNextLine)
        lNextLine = ol.getLong("line_num");
    lNextLine++;
    OrderLine oOrdLn = new OrderLine(oSes, this);
View Full Code Here

Examples of es.ipsa.atril.doc.user.Dms

   
    DAO.log(oSes, invc.getDocument(), Invoice.class, "CREATE INVOICE", AtrilEvent.Level.INFO, "");

    oSes.commit();
    try {
      Dms oDms = oSes.getDms();
      TaxPayer oTxp = new TaxPayer(oDms, sTaxPayer);
      try {
        oTxp.incPendingInvoicesCount(oSes,1l);
      } catch(Exception e) {
        Log.out.error(e.getClass()+" "+e.getMessage(), e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.