-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
2,147 additions
and
2,072 deletions.
There are no files selected for viewing
168 changes: 94 additions & 74 deletions
168
mes-application/src/main/resources/schema/demo_db_cn.sql
Large diffs are not rendered by default.
Oops, something went wrong.
168 changes: 94 additions & 74 deletions
168
mes-application/src/main/resources/schema/demo_db_en.sql
Large diffs are not rendered by default.
Oops, something went wrong.
168 changes: 94 additions & 74 deletions
168
mes-application/src/main/resources/schema/demo_db_fr.sql
Large diffs are not rendered by default.
Oops, something went wrong.
168 changes: 94 additions & 74 deletions
168
mes-application/src/main/resources/schema/demo_db_pl.sql
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
...-product/src/main/java/com/qcadoo/mes/costNormsForProduct/CostNormsForProductService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.qcadoo.mes.costNormsForProduct; | ||
|
||
import com.qcadoo.mes.basic.constants.CurrencyFields; | ||
import com.qcadoo.mes.basic.util.CurrencyService; | ||
import com.qcadoo.mes.costNormsForProduct.constants.ProductFieldsCNFP; | ||
import com.qcadoo.model.api.BigDecimalUtils; | ||
import com.qcadoo.model.api.Entity; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.Objects; | ||
|
||
@Service | ||
public class CostNormsForProductService { | ||
|
||
@Autowired | ||
private CurrencyService currencyService; | ||
|
||
public BigDecimal getNominalCost(final Entity product) { | ||
BigDecimal nominalCost = BigDecimalUtils.convertNullToZero(product.getDecimalField(ProductFieldsCNFP.NOMINAL_COST)); | ||
Entity currency = product.getBelongsToField(ProductFieldsCNFP.NOMINAL_COST_CURRENCY); | ||
|
||
if (Objects.nonNull(currency) && CurrencyService.PLN.equals(currencyService.getCurrencyAlphabeticCode()) | ||
&& !CurrencyService.PLN.equals(currency.getStringField(CurrencyFields.ALPHABETIC_CODE))) { | ||
nominalCost = currencyService.getConvertedValue(nominalCost, currency); | ||
} | ||
|
||
return nominalCost; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
...rders/src/main/java/com/qcadoo/mes/masterOrders/controllers/MasterOrdersControllerMO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.qcadoo.mes.masterOrders.controllers; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import com.qcadoo.mes.basic.ParameterService; | ||
import com.qcadoo.mes.masterOrders.constants.MasterOrdersConstants; | ||
import com.qcadoo.view.api.crud.CrudService; | ||
import org.json.JSONObject; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.servlet.ModelAndView; | ||
|
||
import java.util.Locale; | ||
import java.util.Map; | ||
|
||
@Controller | ||
public class MasterOrdersControllerMO { | ||
|
||
@Autowired | ||
private CrudService crudService; | ||
|
||
@Autowired | ||
private ParameterService parameterService; | ||
|
||
@RequestMapping(value = "salesParameters", method = RequestMethod.GET) | ||
public ModelAndView getSalesParametersPageView(final Locale locale) { | ||
JSONObject json = new JSONObject(ImmutableMap.of("form.id", parameterService.getParameterId().toString())); | ||
|
||
Map<String, String> arguments = ImmutableMap.of("context", json.toString()); | ||
|
||
return crudService.prepareView(MasterOrdersConstants.PLUGIN_IDENTIFIER, "salesParameters", arguments, locale); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.