Package com.abiquo.server.core.pricing

Examples of com.abiquo.server.core.pricing.CostCodeCurrenciesDto


   public static Object costcodecurrencyPut() {
      CostCodeCurrencyDto costcodecurrency = new CostCodeCurrencyDto();
      costcodecurrency.addLink(new RESTLink("edit", "http://localhost/api/config/costcodes/1/currencies"));
      costcodecurrency.addLink(new RESTLink("currency", "http://localhost/api/config/currencies/1"));
      costcodecurrency.setPrice(new BigDecimal("300"));
      CostCodeCurrenciesDto costcodecurrencies = new CostCodeCurrenciesDto();
      costcodecurrencies.add(costcodecurrency);
      return costcodecurrencies;
   }
View Full Code Here


   /*********************** CostCodeCurrency ********************** */

   @Override
   public Iterable<CostCodeCurrency> getCostCodeCurrencies(final Integer costcodeId, final Integer currencyId) {
      CostCodeCurrenciesDto result = context.getApi().getPricingApi().getCostCodeCurrencies(costcodeId, currencyId);
      return wrap(context, CostCodeCurrency.class, result.getCollection());
   }
View Full Code Here

   public void save() {
      target = context.getApi().getPricingApi().createCostCode(target);

      if (defaultPrices != null && !defaultPrices.isEmpty()) {
         CostCodeCurrenciesDto costcodecurrencies = new CostCodeCurrenciesDto();
         for (CostCodePrice ccp : defaultPrices) {
            CostCodeCurrencyDto costcodecurrency = new CostCodeCurrencyDto();
            Currency currency = ccp.getCurrency();

            costcodecurrency.addLink(new RESTLink("currency", currency.unwrap().getEditLink().getHref()));
            costcodecurrency.setPrice(ccp.getPrice());
            costcodecurrencies.add(costcodecurrency);
         }
         context.getApi().getPricingApi().updateCostCodeCurrencies(getId(), costcodecurrencies);
      }

   }
View Full Code Here

TOP

Related Classes of com.abiquo.server.core.pricing.CostCodeCurrenciesDto

Copyright © 2018 www.massapicom. 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.