use of org.compiere.model.I_M_PriceList in project metasfresh-webui-api by metasfresh.
the class ProductsProposalRowsLoader method retrieveCurrencyCode.
private CurrencyCode retrieveCurrencyCode(final PriceListVersionId priceListVersionId) {
final I_M_PriceList priceList = priceListsRepo.getPriceListByPriceListVersionId(priceListVersionId);
final CurrencyId currencyId = CurrencyId.ofRepoId(priceList.getC_Currency_ID());
return currenciesRepo.getCurrencyCodeById(currencyId);
}
use of org.compiere.model.I_M_PriceList in project metasfresh-webui-api by metasfresh.
the class OrderProductProposalsService method getOrderById.
public Order getOrderById(@NonNull final OrderId orderId) {
final I_C_Order orderRecord = ordersRepo.getById(orderId);
final ZonedDateTime datePromised = TimeUtil.asZonedDateTime(orderRecord.getDatePromised());
final PriceListId priceListId = PriceListId.ofRepoId(orderRecord.getM_PriceList_ID());
final I_M_PriceList priceList = priceListsRepo.getById(priceListId);
final PriceListVersionId priceListVersionId = priceListsRepo.retrievePriceListVersionId(priceListId, datePromised);
final BPartnerId bpartnerId = BPartnerId.ofRepoId(orderRecord.getC_BPartner_ID());
final String bpartnerName = bpartnersService.getBPartnerName(bpartnerId);
return Order.builder().orderId(orderId).soTrx(SOTrx.ofBoolean(orderRecord.isSOTrx())).datePromised(datePromised).bpartnerId(bpartnerId).bpartnerName(bpartnerName).pricingSystemId(priceListsRepo.getPricingSystemId(priceListId)).priceListId(priceListId).priceListVersionId(priceListVersionId).countryId(CountryId.ofRepoIdOrNull(priceList.getC_Country_ID())).currencyId(CurrencyId.ofRepoId(priceList.getC_Currency_ID())).lines(ordersRepo.retrieveOrderLines(orderId, I_C_OrderLine.class).stream().map(this::toOrderLine).collect(ImmutableList.toImmutableList())).build();
}
Aggregations