Хм... забавно.
процент скидки не берется из таблицы скидок. Он РАССЧИТЫВАЕТСЯ!!!
Tables : PriceDsicHading :
PHP код:
/*
AOSRunMode::Called
*/
server void updateFinalDisc(PriceDiscLine priceDiscLine)
{
PriceDisc priceDisc;
InventTableModule inventTableModule;
AmountCur balanceEndDisc;
ModuleInventPurchSales moduleType = priceDiscLine.moduleType();
;
while select sum(lineAmount) from priceDiscLine
group by itemId
where priceDiscLine.salesPurchId == this.salesPurchId
&& priceDiscLine.itemId
join inventTableModule
group by endDisc
where inventTableModule.itemId == priceDiscLine.itemId &&
inventTableModule.moduleType == moduleType &&
inventTableModule.endDisc == NoYes::Yes
{
balanceEndDisc += priceDiscLine.lineAmount;
}
priceDisc = new PriceDisc(this.moduleType(),
priceDiscLine.itemId,
priceDiscLine.configId,
priceDiscLine.unit,
systemdateGet(),
priceDiscLine.qty,
this.accountNum,
this.currency);
if (priceDisc.findEndDisc(this.endDisc, balanceEndDisc))
{
if (priceDisc.getDiscAmount() * balanceEndDisc != 0)
{
this.discPercent = balanceEndDisc ? decRound(100 * priceDisc.getDiscAmount() / balanceEndDisc,2) : 0;
this.update();
}
}
}
Надо подумать над этим... Мдя...