Examples of HhStartDate


Examples of net.sf.chellow.physical.HhStartDate

      }
      inv.sendSeeOther(contract.rateScriptsInstance().getEditUri());
    } else {
      String script = inv.getString("script");
      Date startDate = inv.getDateTime("start");
      HhStartDate finishDate = null;
      boolean hasFinished = inv.getBoolean("has-finished");
      if (!inv.isValid()) {
        throw new UserException(document());
      }
      script = script.replace("\r", "").replace("\t", "    ");
View Full Code Here

Examples of net.sf.chellow.physical.HhStartDate

    cal.set(Calendar.MINUTE, 30);
    Bill bill = null;
    try {
      bill = batch.insertBill(MpanCore.getMpanCore(mpanCoreStr)
          .getSupply(), account, reference, issueDate,
          new HhStartDate(startDate), new HhStartDate(cal.getTime()),
          kwh, net, vat, gross, BillType.getBillType(billTypeId),
          breakdown);
    } catch (UserException e) {
      e.setDocument(document());
      throw e;
View Full Code Here

Examples of net.sf.chellow.physical.HhStartDate

      String issueDateStr = GeneralImport.addField(csvElement,
          "Issue Date", values, 4);
      Date issueDate = new MonadDate(issueDateStr).getDate();
      String startDateStr = GeneralImport.addField(csvElement,
          "Start Date", values, 5);
      HhStartDate startDate = new HhStartDate(startDateStr);
      String finishDateStr = GeneralImport.addField(csvElement,
          "Finish Date", values, 6);
      HhStartDate finishDate = new HhStartDate(finishDateStr);
      String netStr = GeneralImport
          .addField(csvElement, "Net", values, 7);
      BigDecimal net = new BigDecimal(netStr);
      String vatStr = GeneralImport
          .addField(csvElement, "Vat", values, 8);
      BigDecimal vat = new BigDecimal(vatStr);

      String grossStr = GeneralImport.addField(csvElement, "Gross",
          values, 9);
      BigDecimal gross = new BigDecimal(grossStr);

      String account = GeneralImport.addField(csvElement,
          "Account Reference", values, 10);

      String reference = GeneralImport.addField(csvElement, "Reference",
          values, 11);
      String typeCode = GeneralImport.addField(csvElement, "Type",
          values, 12);
      BillType type = BillType.getBillType(typeCode);

      String breakdown = GeneralImport.addField(csvElement, "Breakdown",
          values, 13);

      String kwhStr = GeneralImport.addField(csvElement, "kWh", values,
          14);
      BigDecimal kwh = new BigDecimal(kwhStr);

      Bill bill = batch.insertBill(mpanCore.getSupply(), account,
          reference, issueDate, startDate, finishDate, kwh, net, vat,
          gross, type, breakdown);
      for (int i = 15; i < values.length; i += 11) {
        String meterSerialNumber = GeneralImport.addField(csvElement,
            "Meter Serial Number", values, i);
        String mpanStr = GeneralImport.addField(csvElement, "MPAN",
            values, i + 1);
        String coefficientStr = GeneralImport.addField(csvElement,
            "Coefficient", values, i + 2);
        BigDecimal coefficient = new BigDecimal(coefficientStr);
        String unitsStr = GeneralImport.addField(csvElement, "Units",
            values, i + 3);
        Units units = Units.getUnits(unitsStr);
        String tprStr = GeneralImport.addField(csvElement, "TPR",
            values, i + 4);
        Tpr tpr = null;
        if (tprStr.length() > 0) {
          tpr = Tpr.getTpr(tprStr);
        }
        String previousDateStr = GeneralImport.addField(csvElement,
            "Previous Date", values, i + 5);
        HhStartDate previousDate = new HhStartDate(previousDateStr);
        String previousValueStr = GeneralImport.addField(csvElement,
            "Previous Value", values, i + 6);
        BigDecimal previousValue = new BigDecimal(previousValueStr);

        String previousTypeStr = GeneralImport.addField(csvElement,
            "Previous Type", values, i + 7);
        ReadType previousType = ReadType.getReadType(previousTypeStr);

        String presentDateStr = GeneralImport.addField(csvElement,
            "Present Date", values, i + 8);
        HhStartDate presentDate = new HhStartDate(presentDateStr);
        String presentValueStr = GeneralImport.addField(csvElement,
            "Present Value", values, i + 9);
        BigDecimal presentValue = new BigDecimal(presentValueStr);

        String presentTypeStr = GeneralImport.addField(csvElement,
            "Present Type", values, i + 10);
        ReadType presentType = ReadType.getReadType(presentTypeStr);
        bill.insertRead(tpr, coefficient, units, meterSerialNumber,
            mpanStr, previousDate, previousValue, previousType,
            presentDate, presentValue, presentType);
      }
    } else if (action.equals("update")) {
      String billIdStr = GeneralImport.addField(csvElement, "Bill Id",
          values, 0);
      Bill bill = Bill.getBill(Long.parseLong(billIdStr));

      String account = GeneralImport.addField(csvElement,
          "Account Reference", values, 1);
      if (account.equals(GeneralImport.NO_CHANGE)) {
        account = bill.getAccount();
      }

      String reference = GeneralImport.addField(csvElement, "Reference",
          values, 2);
      if (reference.equals(GeneralImport.NO_CHANGE)) {
        reference = bill.getReference();
      }

      String issueDateStr = GeneralImport.addField(csvElement,
          "Issue Date", values, 3);
      Date issueDate = null;
      if (issueDateStr.equals(GeneralImport.NO_CHANGE)) {
        issueDate = bill.getIssueDate();
      } else {
        issueDate = new MonadDate(issueDateStr).getDate();
      }

      String startDateStr = GeneralImport.addField(csvElement,
          "Start Date", values, 4);
      HhStartDate startDate = null;
      if (startDateStr.equals(GeneralImport.NO_CHANGE)) {
        startDate = bill.getStartDate();
      } else {
        startDate = new HhStartDate(startDateStr);
      }

      String finishDateStr = GeneralImport.addField(csvElement,
          "Finish Date", values, 5);
      HhStartDate finishDate = null;
      if (finishDateStr.equals(GeneralImport.NO_CHANGE)) {
        finishDate = bill.getFinishDate();
      } else {
        finishDate = new HhStartDate(finishDateStr);
      }

      String kwhStr = GeneralImport
          .addField(csvElement, "kWh", values, 6);
      BigDecimal kwh = null;
View Full Code Here

Examples of net.sf.chellow.physical.HhStartDate

      if (!inv.isValid()) {
        throw new UserException(document());
      }
      try {
        update(account, reference, issueDate,
            new HhStartDate(startDate),
            new HhStartDate(finishDate), kwh, net, vat, gross,
            BillType.getBillType(typeId), breakdown);
      } catch (UserException e) {
        e.setDocument(document());
        throw e;
      }
View Full Code Here

Examples of net.sf.chellow.physical.HhStartDate

        .session()
        .createQuery(
            "from RateScript script where script.contract = :contract and script.startDate.date <= :startDate and (script.finishDate is null or script.finishDate.date >= :startDate)")
        .setEntity("contract", this)
        .setTimestamp("startDate", startDate.getDate()).uniqueResult();
    HhStartDate finishDate = null;
    if (coveredRateScript == null) {
      finishDate = rateScripts.get(0).getStartDate().getPrevious();
    } else {
      if (coveredRateScript.getStartDate().equals(
          coveredRateScript.getFinishDate())) {
View Full Code Here

Examples of net.sf.chellow.physical.HhStartDate

          .getParticipant(participantCode);
      String name = GeneralImport.addField(csvElement, "Name", values, 2);

      String startDateStr = GeneralImport.addField(csvElement,
          "Start Date", values, 3);
      HhStartDate startDate = new HhStartDate(startDateStr);
      String finishDateStr = GeneralImport.addField(csvElement,
          "Finish Date", values, 4);
      HhStartDate finishDate = null;
      if (finishDateStr.length() > 0) {
        finishDate = new HhStartDate(finishDateStr);
      }
      String chargeScript = GeneralImport.addField(csvElement,
          "Charge Script", values, 5);

      String rateScriptIdStr = GeneralImport.addField(csvElement,
View Full Code Here

Examples of net.sf.chellow.physical.HhStartDate

     
      String name = GeneralImport.addField(csvElement, "Name", values, 2);

      String startDateStr = GeneralImport.addField(csvElement,
          "Start Date", values, 3);
      HhStartDate startDate = new HhStartDate(startDateStr);
      String finishDateStr = GeneralImport.addField(csvElement,
          "Finish Date", values, 4);
      HhStartDate finishDate = null;
      if (finishDateStr.length() > 0) {
        finishDate = new HhStartDate(finishDateStr);
      }
      String chargeScript = GeneralImport.addField(csvElement,
          "Charge Script", values, 5);

      String rateScriptIdStr = GeneralImport.addField(csvElement,
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.