Example usage for java.math BigDecimal intValue

List of usage examples for java.math BigDecimal intValue

Introduction

In this page you can find the example usage for java.math BigDecimal intValue.

Prototype

@Override
public int intValue() 

Source Link

Document

Converts this BigDecimal to an int .

Usage

From source file:org.openhab.binding.yamahareceiver.handler.YamahaBridgeHandler.java

/**
 * Calls createCommunicationObject if the host name is configured correctly.
 *//*from  w ww  . ja  v  a  2  s . co  m*/
@Override
public void initialize() {
    // Read the configuration for the relative volume change factor.
    BigDecimal relativeVolumeChangeFactorBD = (BigDecimal) thing.getConfiguration()
            .get(YamahaReceiverBindingConstants.CONFIG_RELVOLUMECHANGE);
    if (relativeVolumeChangeFactorBD != null) {
        relativeVolumeChangeFactor = relativeVolumeChangeFactorBD.floatValue();
    }

    String host = (String) thing.getConfiguration().get(YamahaReceiverBindingConstants.CONFIG_HOST_NAME);
    BigDecimal port = (BigDecimal) thing.getConfiguration()
            .get(YamahaReceiverBindingConstants.CONFIG_HOST_PORT);

    if (StringUtils.isEmpty(host) || port == null) {
        updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, "Hostname or port not set!");
        return;
    }

    zoneDiscoveryService = new ZoneDiscoveryService(bundleContext);

    updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_PENDING, "Waiting for data");
    ProtocolFactory.createConnection(host + ":" + String.valueOf(port.intValue()), this);
}

From source file:org.openvpms.archetype.rules.supplier.OrderGeneratorTestCase.java

/**
 * Verifies that tax amounts are rounded correctly, if a product is taxed.
 *//*  w  ww .j  av a2 s .c om*/
@Test
public void testCreateOrderForProductWithTax() {
    OrderGenerator generator = new OrderGenerator(taxRules, getArchetypeService());
    Party stockLocation = SupplierTestHelper.createStockLocation();
    Party supplier = TestHelper.createSupplier();
    Product product = TestHelper.createProduct();
    product.addClassification(gst);
    save(product);

    BigDecimal total = new BigDecimal("1292.54");
    BigDecimal taxAmount = new BigDecimal("117.50");
    BigDecimal quantity = new BigDecimal("96");
    addRelationships(product, stockLocation, supplier, true, 0, quantity.intValue(), 0, new BigDecimal("12.24"),
            1);

    List<FinancialAct> order = generator.createOrder(supplier, stockLocation, false);
    save(order);
    checkOrder(order.get(0), supplier, stockLocation, total, taxAmount);
    checkOrderItem(order.get(1), product, quantity, total, taxAmount);
}

From source file:de.csdev.ebus.command.datatypes.ext.EBusTypeTime.java

@Override
public EBusDateTime decodeInt(byte[] data) throws EBusTypeException {

    Calendar calendar = new GregorianCalendar(1970, 0, 1, 0, 0, 0);

    BigDecimal second = null;//  ww  w. ja  v a2s. c  o m
    BigDecimal minute = null;
    BigDecimal hour = null;

    if (data.length != getTypeLength()) {
        throw new EBusTypeException("Input byte array must have a length of %d bytes!", getTypeLength());
    }

    if (StringUtils.equals(variant, SHORT)) {
        IEBusType<BigDecimal> bcdType = types.getType(EBusTypeBCD.TYPE_BCD);
        minute = bcdType.decode(new byte[] { data[0] });
        hour = bcdType.decode(new byte[] { data[1] });

    } else if (StringUtils.equals(variant, DEFAULT)) {
        IEBusType<BigDecimal> bcdType = types.getType(EBusTypeBCD.TYPE_BCD);
        second = bcdType.decode(new byte[] { data[0] });
        minute = bcdType.decode(new byte[] { data[1] });
        hour = bcdType.decode(new byte[] { data[2] });

    } else if (StringUtils.equals(variant, HEX)) {
        IEBusType<BigDecimal> charType = types.getType(EBusTypeChar.TYPE_CHAR);
        second = charType.decode(new byte[] { data[0] });
        minute = charType.decode(new byte[] { data[1] });
        hour = charType.decode(new byte[] { data[2] });

    } else if (StringUtils.equals(variant, HEX_SHORT)) {
        IEBusType<BigDecimal> charType = types.getType(EBusTypeChar.TYPE_CHAR);
        minute = charType.decode(new byte[] { data[0] });
        hour = charType.decode(new byte[] { data[1] });

    } else if (StringUtils.equals(variant, MINUTES) || StringUtils.equals(variant, MINUTES_SHORT)) {

        BigDecimal minutesSinceMidnight = null;
        if (StringUtils.equals(variant, MINUTES_SHORT)) {
            IEBusType<BigDecimal> type = types.getType(EBusTypeUnsignedNumber.TYPE_UNUMBER, IEBusType.LENGTH,
                    1);
            minutesSinceMidnight = type.decode(data);
        } else {
            IEBusType<BigDecimal> type = types.getType(EBusTypeUnsignedNumber.TYPE_UNUMBER, IEBusType.LENGTH,
                    2);
            minutesSinceMidnight = type.decode(data);
        }

        minutesSinceMidnight = minutesSinceMidnight.multiply(minuteMultiplier);

        if (minutesSinceMidnight.intValue() > 1440) {
            throw new EBusTypeException("Value 'minutes since midnight' to large!");
        }

        calendar.add(Calendar.MINUTE, minutesSinceMidnight.intValue());
    }

    if (second != null) {
        calendar.set(Calendar.SECOND, second.intValue());
    }
    if (minute != null) {
        calendar.set(Calendar.MINUTE, minute.intValue());
    }
    if (hour != null) {
        calendar.set(Calendar.HOUR_OF_DAY, hour.intValue());
    }

    return new EBusDateTime(calendar, true, false);
}

From source file:org.yes.cart.shoppingcart.impl.ShoppingCartImpl.java

/** {@inheritDoc} */
@JsonIgnore/*from   w ww.  j a v  a 2s. co m*/
public int getCartItemsCount() {
    BigDecimal quantity = BigDecimal.ZERO;
    for (CartItem cartItem : getItems()) {
        quantity = quantity.add(cartItem.getQty());
    }
    for (CartItem cartItem : getGifts()) {
        quantity = quantity.add(cartItem.getQty());
    }
    return quantity.intValue();
}

From source file:de.csdev.ebus.service.device.EBusDeviceTable.java

public void updateDevice(byte address, Map<String, Object> data) {

    boolean newDevice = false;
    boolean updatedDevice = false;

    if (address == EBusConsts.BROADCAST_ADDRESS) {
        return;/* ww w .j  a  va2  s.  com*/
    } else if (EBusUtils.isMasterAddress(address)) {
        address = EBusUtils.getSlaveAddress(address);
    }

    if (address == getOwnDevice().getSlaveAddress()) {
        // ignore own address
        return;
    }

    EBusDevice device = deviceTable.get(address);

    if (device == null) {
        device = new EBusDevice(address, this);
        device.setLastActivity(System.currentTimeMillis());
        deviceTable.put(address, device);
        newDevice = true;
    }

    device.setLastActivity(System.currentTimeMillis());

    if (data != null && !data.isEmpty()) {

        Object obj = data.get("device_id");
        if (obj != null && !obj.equals(device.getDeviceId())) {
            device.setDeviceId((byte[]) obj);
            updatedDevice = true;
        }

        BigDecimal obj2 = NumberUtils.toBigDecimal(data.get("hardware_version"));
        if (obj2 != null && !ObjectUtils.equals(obj2, device.getHardwareVersion())) {
            device.setHardwareVersion(obj2);
            updatedDevice = true;
        }

        obj2 = NumberUtils.toBigDecimal(data.get("software_version"));
        if (obj2 != null && !ObjectUtils.equals(obj2, device.getSoftwareVersion())) {
            device.setSoftwareVersion(obj2);
            updatedDevice = true;
        }

        obj2 = NumberUtils.toBigDecimal(data.get("vendor"));
        if (obj2 != null && !ObjectUtils.equals(obj2.byteValue(), device.getManufacturer())) {
            int intValue = obj2.intValue();
            device.setManufacturer((byte) intValue);
            updatedDevice = true;
        }
    }

    if (newDevice) {
        fireOnDeviceUpdate(IEBusDeviceTableListener.TYPE.NEW, device);
    } else if (updatedDevice) {
        fireOnDeviceUpdate(IEBusDeviceTableListener.TYPE.UPDATE, device);
    } else {
        fireOnDeviceUpdate(IEBusDeviceTableListener.TYPE.UPDATE_ACTIVITY, device);
    }
}

From source file:it.av.es.service.impl.OrderServiceHibernate.java

/**
 * {@inheritDoc}/*from www. j  a va 2s .  co m*/
 */
@Override
public Order forcePriceAndDiscountAndRecalculate(Order o, BigDecimal cost, BigDecimal discountForced) {
    for (ProductOrdered p : o.getProductsOrdered()) {
        p.setAmount(cost.multiply(BigDecimal.valueOf(p.getNumber())));
        p.setDiscount(discountForced.intValue());
    }
    return o;
}

From source file:com.forrestguice.suntimeswidget.LocationConfigView.java

/**
 * Check text fields for validity; as a side-effect sets an error message on fields with invalid
 * values.//w ww.j  a v a2  s .c o m
 * @return true if all fields valid, false otherwise
 */
public boolean validateInput() {
    boolean isValid = true;

    String latitude = text_locationLat.getText().toString();
    try {
        BigDecimal lat = new BigDecimal(latitude);
        if (lat.intValue() < -90 || lat.intValue() > 90) {
            isValid = false;
            text_locationLat.setError(myParent.getString(R.string.location_dialog_error_lat));
        }

    } catch (NumberFormatException e1) {
        isValid = false;
        text_locationLat.setError(myParent.getString(R.string.location_dialog_error_lat));
    }

    String longitude = text_locationLon.getText().toString();
    try {
        BigDecimal lon = new BigDecimal(longitude);
        if (lon.intValue() < -180 || lon.intValue() > 180) {
            isValid = false;
            text_locationLon.setError(myParent.getString(R.string.location_dialog_error_lon));
        }

    } catch (NumberFormatException e2) {
        isValid = false;
        text_locationLon.setError(myParent.getString(R.string.location_dialog_error_lon));
    }

    return isValid;
}

From source file:com.salesmanager.core.module.impl.integration.shipping.FedexRequestQuotesImpl.java

public Collection<ShippingOption> getQuote(String carrier, String deliveryType, String module,
        Collection<PackageDetail> packages, BigDecimal orderTotal, ConfigurationResponse vo,
        MerchantStore store, Customer customer, Locale locale) throws Exception {
    // Build a RateRequest request object
    boolean getAllRatesFlag = true; // set to true to get the rates for
    // different service types
    RateRequest request = new RateRequest();
    request.setClientDetail(createClientDetail(module, vo));
    request.setWebAuthenticationDetail(createWebAuthenticationDetail(module, vo));

    Collection returnColl = null;
    int icountry = store.getCountry();
    String country = CountryUtil.getCountryIsoCodeById(icountry);

    IntegrationProperties props = (IntegrationProperties) vo.getConfiguration(module + "-properties");

    ShippingService sservice = (ShippingService) ServiceFactory.getService(ServiceFactory.ShippingService);
    CoreModuleService cms = sservice.getRealTimeQuoteShippingService(country, module);

    /** Details on whit RT quote information to display **/
    MerchantConfiguration rtdetails = vo
            .getMerchantConfiguration(ShippingConstants.MODULE_SHIPPING_DISPLAY_REALTIME_QUOTES);
    int displayQuoteDeliveryTime = ShippingConstants.NO_DISPLAY_RT_QUOTE_TIME;
    if (rtdetails != null) {

        if (!StringUtils.isBlank(rtdetails.getConfigurationValue1())) {// display
            // or
            // not
            // quotes
            try {
                displayQuoteDeliveryTime = Integer.parseInt(rtdetails.getConfigurationValue1());

            } catch (Exception e) {
                log.error("Display quote is not an integer value [" + rtdetails.getConfigurationValue1() + "]");
            }//from  w w w.j  ava 2 s  .c  o  m
        }
    }
    /**/

    if (cms == null) {
        // throw new
        // Exception("Central integration services not configured for " +
        // PaymentConstants.PAYMENT_PSIGATENAME + " and country id " +
        // origincountryid);
        log.error("CoreModuleService not configured for " + carrier + " and country id " + icountry);
        return null;
    }

    String host = cms.getCoreModuleServiceProdDomain();
    String protocol = cms.getCoreModuleServiceProdProtocol();
    String port = cms.getCoreModuleServiceProdPort();
    String url = cms.getCoreModuleServiceProdEnv();
    if (props.getProperties1().equals(String.valueOf(ShippingConstants.TEST_ENVIRONMENT))) {
        host = cms.getCoreModuleServiceDevDomain();
        protocol = cms.getCoreModuleServiceDevProtocol();
        port = cms.getCoreModuleServiceDevPort();
        url = cms.getCoreModuleServiceDevEnv();
    }

    //
    TransactionDetail transactionDetail = new TransactionDetail();
    transactionDetail.setCustomerTransactionId("Shopizer salesmanager"); // The
    // client
    // will
    // get
    // the
    // same
    // value
    // back
    // in
    // the
    // response
    request.setTransactionDetail(transactionDetail);

    //
    VersionId versionId = new VersionId("crs", 5, 0, 0);
    request.setVersion(versionId);

    //
    RequestedShipment requestedShipment = new RequestedShipment();

    requestedShipment.setShipTimestamp(Calendar.getInstance());
    requestedShipment.setDropoffType(DropoffType.REGULAR_PICKUP);

    MerchantConfiguration packageServices = vo
            .getMerchantConfiguration(module + "-" + ShippingConstants.MODULE_SHIPPING_RT_PKG_DOM_INT);
    String packageOption = packageServices.getConfigurationValue();

    PackagingType pType = getPackagingType(packageOption);

    if (deliveryType != null) {
        // requestedShipment.setServiceType(sType);
        ServiceType sType = getServiceType(deliveryType);
    }

    // if (! getAllRatesFlag) {
    // requestedShipment.setServiceType(ServiceType.INTERNATIONAL_PRIORITY);
    // requestedShipment.setServiceType(sType);
    requestedShipment.setPackagingType(pType);
    // }

    //

    Map countriesMap = (Map) RefCache
            .getAllcountriesmap(LanguageUtil.getLanguageNumberCode(locale.getLanguage()));
    Country c = (Country) countriesMap.get(store.getCountry());

    Map zonesMap = (Map) RefCache.getAllZonesmap(LanguageUtil.getLanguageNumberCode(locale.getLanguage()));
    // Zone z = CountryUtil.getZoneCodeByName(store.getZone(),
    // LanguageUtil.getLanguageNumberCode(locale.getCountry()));

    Zone zone = (Zone) zonesMap.get(Integer.parseInt(store.getZone()));
    String zoneName = null;
    if (zone == null) {
        zoneName = "N/A";
    } else {
        zoneName = zone.getZoneCode();
    }

    /*
     * String originZone = zoneName; if(originZone.endsWith("QC")) {
     * originZone = "PQ"; }
     */

    // origin
    Party shipper = new Party();
    Address shipperAddress = new Address(); // Origin information
    shipperAddress.setStreetLines(new String[] { store.getStoreaddress() });
    shipperAddress.setCity(store.getStorecity());
    shipperAddress.setStateOrProvinceCode(zoneName);
    shipperAddress
            .setPostalCode(com.salesmanager.core.util.ShippingUtil.trimPostalCode(store.getStorepostalcode()));
    shipperAddress.setCountryCode(c.getCountryIsoCode2());
    shipper.setAddress(shipperAddress);
    requestedShipment.setShipper(shipper);

    Zone customerZone = (Zone) zonesMap.get(customer.getCustomerZoneId());
    Country customerCountry = (Country) countriesMap.get(customer.getCustomerCountryId());
    String customerZoneName = null;
    if (zone == null) {
        customerZoneName = "N/A";
    } else {
        customerZoneName = customerZone.getZoneCode();
    }

    /*
     * String destZone = customerZoneName; if(destZone.endsWith("QC")) {
     * destZone = "PQ"; }
     */

    // destination
    Party recipient = new Party();
    Address recipientAddress = new Address(); // Destination information
    recipientAddress.setStreetLines(new String[] { customer.getCustomerStreetAddress() });
    recipientAddress.setCity(customer.getCustomerCity());
    recipientAddress.setStateOrProvinceCode(customerZoneName);
    recipientAddress.setPostalCode(
            com.salesmanager.core.util.ShippingUtil.trimPostalCode(customer.getCustomerPostalCode()));
    recipientAddress.setCountryCode(customerCountry.getCountryIsoCode2());

    recipient.setAddress(recipientAddress);
    requestedShipment.setRecipient(recipient);

    //
    Payment shippingChargesPayment = new Payment();
    shippingChargesPayment.setPaymentType(PaymentType.SENDER);
    requestedShipment.setShippingChargesPayment(shippingChargesPayment);

    // build packages

    RequestedPackage[] rpArray = new RequestedPackage[packages.size()];

    Iterator packagesIterator = packages.iterator();
    int i = 0;
    while (packagesIterator.hasNext()) {

        PackageDetail detail = (PackageDetail) packagesIterator.next();
        RequestedPackage rp = new RequestedPackage();

        Weight w = null;
        if (store.getWeightunitcode().equals(Constants.LB_WEIGHT_UNIT)) {
            w = new Weight(WeightUnits.LB, new BigDecimal(detail.getShippingWeight()));
        } else {
            w = new Weight(WeightUnits.KG, new BigDecimal(detail.getShippingWeight()));
        }

        Dimensions d = null;

        BigDecimal h = new BigDecimal(detail.getShippingHeight());
        h.setScale(2, BigDecimal.ROUND_UP);
        int ih = h.intValue();

        BigDecimal sw = new BigDecimal(detail.getShippingWeight());
        sw.setScale(2, BigDecimal.ROUND_UP);
        int isw = sw.intValue();

        BigDecimal sw2 = new BigDecimal(detail.getShippingWidth());
        sw2.setScale(2, BigDecimal.ROUND_UP);
        int isw2 = sw2.intValue();

        if (store.getSeizeunitcode().equals(Constants.INCH_SIZE_UNIT)) {
            d = new Dimensions(new NonNegativeInteger(String.valueOf(ih)),
                    new NonNegativeInteger(String.valueOf(isw)), new NonNegativeInteger(String.valueOf(isw2)),
                    LinearUnits.IN);
        } else {
            d = new Dimensions(new NonNegativeInteger(String.valueOf(ih)),
                    new NonNegativeInteger(String.valueOf(isw)), new NonNegativeInteger(String.valueOf(isw2)),
                    LinearUnits.CM);
        }

        rp.setWeight(w);
        // insurance
        // rp.setInsuredValue(new Money(store.getCurrency(), new
        // BigDecimal("100.00")));
        //
        rp.setDimensions(d);
        PackageSpecialServicesRequested pssr = new PackageSpecialServicesRequested();
        rp.setSpecialServicesRequested(pssr);

        rpArray[i] = rp;
        i++;

    }
    requestedShipment.setRequestedPackages(rpArray);

    requestedShipment.setPackageCount(new NonNegativeInteger(String.valueOf(packages.size())));
    requestedShipment.setRateRequestTypes(new RateRequestType[] { RateRequestType.ACCOUNT });
    requestedShipment.setPackageDetail(RequestedPackageDetailType.INDIVIDUAL_PACKAGES);
    request.setRequestedShipment(requestedShipment);

    //
    try {
        // Initialize the service
        RateServiceLocator service;
        RatePortType p;
        //
        service = new RateServiceLocator();

        // updateEndPoint(service);
        String endPointUrl = protocol + "://" + host + ":" + port + url;

        service.setRateServicePortEndpointAddress(endPointUrl);

        p = service.getRateServicePort();
        // This is the call to the web service passing in a RateRequest and
        // returning a RateReply
        RateReply reply = p.getRates(request); // Service call
        if (isResponseOk(reply.getHighestSeverity())) {
            returnColl = writeServiceOutput(displayQuoteDeliveryTime, reply, module, carrier, locale,
                    store.getCurrency());
        }
        printNotifications(store, reply.getNotifications());

    } catch (RuntimeException e) {
        e.printStackTrace();
        log.error(e);
    } catch (Exception ex) {
        log.error(ex);
    }

    return returnColl;
}

From source file:org.appcelerator.titanium.util.TiUIHelper.java

public static void applyMathDict(final KrollDict mathDict, final KrollDict event, final KrollProxy source) {
    if (event == null)
        return;/*from w w w .  ja va2  s.  c  om*/
    KrollDict expressions = new KrollDict();

    HashMap<String, Object> vars = mathDict.getHashMap("variables");
    if (vars != null) {
        for (Map.Entry<String, Object> entry : vars.entrySet()) {
            Object value = entry.getValue();
            if (value instanceof String) {
                expressions.put(VAR_PREFIX + entry.getKey(), getValueForKeyPath((String) value, event));
            } else {
                expressions.put(VAR_PREFIX + entry.getKey(), value);
            }
        }
    }

    String condition = mathDict.getString("condition");
    if (condition != null) {
        try {
            Expression expression = new Expression(condition);
            for (Map.Entry<String, Object> entry2 : expressions.entrySet()) {
                Object value = entry2.getValue();
                if (value instanceof String) {
                    expression.with(entry2.getKey(), (String) value);
                } else if (value instanceof Boolean) {
                    expression.with(entry2.getKey(), BigDecimal.valueOf((boolean) value ? 1 : 0));
                } else if (value instanceof Integer || value instanceof Double) {
                    expression.with(entry2.getKey(), BigDecimal.valueOf((double) value));
                }
            }
            BigDecimal result = expression.eval();
            if (result.intValue() == 0) {
                return;
            }
        } catch (Exception e) {
            TiApplication.showExceptionError(e);
        }
    }

    HashMap<String, Object> exps = mathDict.getHashMap("expressions");
    if (exps != null) {
        for (Map.Entry<String, Object> entry : exps.entrySet()) {

            //               Scope scope = Scope.create();
            //               try {
            //                    for (Map.Entry<String, Object> entry2 : expressions.entrySet()) {
            //                        Variable v = scope.getVariable("$"+entry2.getKey());
            //                        v.setValue(TiConvert.toFloat(entry2.getValue()));
            //                    }
            //                    parsii.eval.Expression expr = Parser.parse(TiConvert.toString(entry.getValue()), scope);
            //                    expressions.put(entry.getKey(), expr.evaluate());
            //                    
            //                } catch (ParseException e1) {
            //                } 

            try {
                Expression expression = new Expression(TiConvert.toString(entry.getValue()));
                for (Map.Entry<String, Object> entry2 : expressions.entrySet()) {
                    String value = TiConvert.toString(entry2.getValue());
                    if (value != null) {
                        expression.with(entry2.getKey(), value);
                    }
                }
                expressions.put(VAR_PREFIX + entry.getKey(), expression.eval().toPlainString());
            } catch (Exception e) {
                TiApplication.showExceptionError(e);
                //                    return; 
            }
        }
    }

    Object[] targets = mathDict.getArray("targets");

    if (targets != null) {
        for (Object obj : targets) {
            HashMap<String, Object> targetDict = TiConvert.toHashMap(obj);
            if (targetDict != null) {
                Object target = targetDict.get("target");
                if (target == null) {
                    target = source;
                } else if (target instanceof String) {
                    target = source.getProperty((String) target);
                }
                if (target instanceof KrollProxy) {
                    HashMap<String, Object> targetVariables = TiConvert
                            .toHashMap(targetDict.get("targetVariables"));
                    if (targetVariables != null) {
                        for (Map.Entry<String, Object> entry : targetVariables.entrySet()) {
                            final String key = entry.getKey();
                            Object current = ((KrollProxy) target)
                                    .getProperty(TiConvert.toString(entry.getValue()), true);
                            if (current != null) {
                                expressions.put(VAR_PREFIX + key, current);
                            } else {
                                expressions.put(VAR_PREFIX + key, 0);
                            }
                        }
                    }
                    HashMap realProps = prepareExpressions((KrollProxy) target, targetDict, expressions, null);
                    ((KrollProxy) target).applyPropertiesInternal(realProps, false, false);
                }
            }
        }
    }
}

From source file:org.zephyrsoft.trackworktime.timer.TimerManager.java

/**
 * Get the normal work time (in minutes) for a specific week day.
 *//*from  www.  j av a 2s  . c  o  m*/
public int getNormalWorkDurationFor(WeekDayEnum weekDay) {
    if (isWorkDay(weekDay)) {
        String targetValueString = preferences.getString(Key.FLEXI_TIME_TARGET.getName(), "0:00");
        targetValueString = DateTimeUtil.refineHourMinute(targetValueString);
        TimeSum targetValue = parseHoursMinutesString(targetValueString);
        BigDecimal minutes = new BigDecimal(targetValue.getAsMinutes()).divide(new BigDecimal(countWorkDays()),
                RoundingMode.HALF_UP);
        return minutes.intValue();
    } else {
        return 0;
    }
}