GoTO >>Class PriceDisc
Goto >>Method>>
client server
static AmountCur price2Amount(PriceCur price,
PriceUnit priceUnit,
DiscAmount discAmount,
Qty qtyNow,
Qty qty,
MarkupAmount markup,
DiscPct discPercent,
CurrencyCode currencyCode,
Amount amount,
boolean forceAmountCalculation = false)
{
Amount
returnAmount;
// <GEEPL>
#ISOCountryRegionCodes
// </GEEPL>
;
if (!price && !discAmount &&
!discPercent && !markup && !forceAmountCalculation)
{
if (qtyNow == qty)
return amount;
else
price = PriceDisc::amount2Price(amount,
discPercent,
markup,
qty,
discAmount,
priceUnit,
currencyCode,
price);
}
if (price
|| discAmount || discPercent || markup || forceAmountCalculation)
{
if (!priceUnit)
priceUnit = 1;
// <GEEPL>
if
(SysCountryRegionCode::isLegalEntityInCountryRegion([#isoPL]) &&
SalesParameters::find().LineDiscCalculation_PL == PlLineDiscCalcType::PcsPrice
&&
(discAmount || markup || discPercent))
{
returnAmount = (qtyNow / priceUnit) * Currency::amount((price -
discAmount + markup) * (100 -
discPercent) / 100, currencyCode);
}
else
{
//
</GEEPL>
returnAmount = (qtyNow * ((price - discAmount) / priceUnit) + (qtyNow
>= 0 ? markup : -markup) ) * (100 - discPercent) / 100;
// <GEEPL>
}
// </GEEPL>
returnAmount = Currency::amount(returnAmount, currencyCode);
}
else
{
returnAmount = amount;
}
return returnAmount;
}
No comments:
Post a Comment